:L1(L->S //Set S to the number of stones in the chosen lest element :R(P=2)+(14-R)(P=1)->L //Calculate L Based on R and the player number (right now, L is the list element number that was chosen) :min(6,max(1,R+(K=34)-(K=25->R //Depending on input, add or subtract 1 from R, within the bounds :Output(R+1,4(P=2)+13(P=1),sub("",P,1 //Display the appropriate cursor at the relative R coordinate and at the x value of 4 if P=2 and at 13 if P=1 :Repeat K=105 and L1(R(P=2)+(14-R)(P=1))!=0 //repeat input routine until user presses enter and the current house is not empty :1->R //initialize R which is the row input number :For(A,1,6 // Display the board after clearing possible extra numbers. :1+(P=1->P //switch player between 1 and 2 :If L!=7 and L!=14 //Does not switch player if L = 7 or 14, allows for extra turns :Repeat W // Main loop, Keep playing until W is no longer = 0, (equals 1 or 2) :0->L1(14 //L1 setup finished here board ready The first player to clear their side of the board of stones wins.Īfter first turn: player 1 has chosen the fourth house from the top, the last stone fell in a well, so player 1 will go again. If the last stone falls in one of the wells, then the player gets another turn. The stones from that house get distributed by picking them up, and placing 1 stone in each house consecutive to the last, going around in a counter-clockwise pattern until the stones run out. Programmed by TI-GBR and optimised by the TI-Basic Developer community (see credits for details) Version 2 rules:īoard 6 by 2 active houses with 4 stones starting in each, and two wells, one at either end.Įach player, on their turn, chooses a house on their side of the board. If not(sum(L1,1,6 //Tried to a piecewise thing here had to settle for two If's Output(C,D+(I>=9),I //Greater than or equal to 9 L1(7→H //Saves a couple of bytes to do this
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |