Hi. Iam doing my first game and its going very well.
Its the classic African Kalah (with egyptian rules)
There is a problem. And you gotta know the basics of kalah to solve it.
hole1(4)--hole2(4)...
there are 12 holes. When i click the first one, the next 4 holes get 1 more piece., But when I click hole2, that has now 5 pieces, only the next four get 1 more. The next 5 should get 1 more piece.
Code:
function move(hole)
{
holeID = hole.id
holeNum = holeID.replace(/hole/,'')
holeBalls = hole.value
hole.value = 0
holeNum++
holeBalls++
for (d=holeNum;d<=holeBalls;d++)
{
document.getElementById('hole'+d).value ++
}
}
each hole executes move(this) onclick