So im creating a takeaway game for this project.
the theory of takeaway real quick:
Given in input a certain # of pennies > 0
can only takeaway in one turn 1 , 2 or 3 pennies
the person to takeaway the last penny loses
the human is first person to takeaway pennies.
every position has either a lose or win condition, meaning resulting from that
position if the user can win from it, its a win position , if theres no possible
way to win then its a lose position.
writin this in c++
im having trouble making the tree,
say i have 5 pennies then possible positions from this is 2 , 3 or 4
how do i make it so the nodes 2 , 3 and 4 point to the root or any node above it.
i keep getting errors using pointers.
thnx
the theory of takeaway real quick:
Given in input a certain # of pennies > 0
can only takeaway in one turn 1 , 2 or 3 pennies
the person to takeaway the last penny loses
the human is first person to takeaway pennies.
every position has either a lose or win condition, meaning resulting from that
position if the user can win from it, its a win position , if theres no possible
way to win then its a lose position.
writin this in c++
im having trouble making the tree,
say i have 5 pennies then possible positions from this is 2 , 3 or 4
how do i make it so the nodes 2 , 3 and 4 point to the root or any node above it.
i keep getting errors using pointers.
thnx