Talk:Tic Tac Toe

From Esolang
Jump to: navigation, search

Stack based

Well, since someone kicked me off of the #esoteric IRC channel, I am now taking suggestions here. What can I do to make this stack based? --(this comment by JWinslow23 at 16:24, 5 October 2013‎ UTC; please sign your comments with ~~~~)

You could add a register and some commands to manipulate the register. Then you could add a few commands to manipulate the stack such as a command to push the register value onto the stack and a command to pop the top value off of the stack into the register. However, you would need to get rid of some of the current commands due to the limited size of a Tic Tac Toe board. OriginalOldMan (talk) 01:29, 6 October 2013 (UTC)

So, what commands are they? Keep in mind, there are only 8. --JWinslow23 (talk) 15:17, 6 October 2013 (UTC)

Well, you could add commands to increment, decrement and square the value in the register. You could also add 9 more commands by having X invoke one set of commands while O invokes another. For example, placing X in square a1 could increment the register value, while placing O in square a1 could decrement it. For stack manipulation, you could add commands for pushing a value from the register onto the stack, and one for popping the top value of the stack into the register. You could also add commands for adding, subtracting, multiplying and dividing the top 2 values of the stack and pushing the result to the top of the stack. OriginalOldMan (talk) 17:29, 6 October 2013 (UTC)