I have a dice and chips game that I devised I would like to create for the iPad. The only programming experience I have is with my TRS 80 over 25 years ago using basic. I need to create the play field with dice and chips and be able to show the movement of the chips. Once that is complete I need to be able to produce an artificial intelligence routine to play against human player. The algorithm for this part will be the most interesting I believe.

How should I start at this? I'm not really interested in becoming a well-rounded good programmer, I just want to get this project working. Perhaps there is an open source code for a backgammon game that I could take for my own use? What would be the best languages for me to try to take up? Is Java appropriate for this project?

Please be gentle with me :-)

Dani AI

Generated

A short practical plan that fits ’s goal of “get the project working” without becoming a full-time programmer: separate the project into (1) a rules engine and deterministic test harness, (2) a minimal visual layer that can show dice and chip movement, and (3) an AI that can be replaced or improved later. ’s note about Objective‑C reflects older iOS practice; for a new iPad project in current toolchains the common, lower-friction path is Swift with SwiftUI for UI plus SpriteKit (or a simple UIKit layer) for 2D animation. Java is not a normal choice for native iOS development.

Concrete implementation sequence: model the board and legal-move generator first and write unit tests that run without any UI. Represent the board as a small, testable structure and assert legal-move invariants (bearing off, doubles, bar/entering, hitting). Keep model and view separate so the AI and animations can be developed independently.

Example minimal model shape:

struct Board {
  // 24 points: positive = player A count, negative = player B count
  var points: [Int]        // length 24
  var bar: (Int, Int)      // checkers on the bar for each player
  var off: (Int, Int)      // borne off counts
}

AI strategy progression and a simple algorithm to get a usable CPU quickly: start with rule-based heuristics (hit blots if safe, avoid leaving blots, prefer anchors), then move to Monte Carlo rollouts for each legal move (simulate many random continuations and pick the highest win rate). Monte Carlo pseudocode:

for each legalMove m:
  wins = 0
  for i in 1..N:
    simulate random playout from state after m
    if playout result = win: wins += 1
  score[m] = wins / N
choose move with max score

Practical tips: seed the RNG for repeatable tests, log illegal states aggressively, animate chip motion along simple straight/Bezier paths and use layering/zPosition to avoid overlap glitches. For stronger play, study existing open-source backgammon engines (check licensing before reuse) rather than re-inventing all evaluation plumbing.

Recommended Answers

All 2 Replies

Objective-C would probably be the best bet for iPad.

Good luck learning programming ad-hoc.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.