Game Logic

Hey Everybody,

I need some starter code on some gamelogic. I am a newby and I have not found any code on this site that does what I’m looking for. I need to know how to write logic similar to a tic tac toe game. For instance if you have a x in a location or a gamepiece, the system knows you have it there. And then if you have a piece that does not go there, the system knows that too. Can somebody show me how the code would look if you had 3 X’s in a row or 3 O’s in a row. Is this if then type of logic? I don’t have any code now so I can’t show you because I don’t know how to even start that.

Michelle [import]uid: 72372 topic_id: 12562 reply_id: 312562[/import]

are you familiar with flash actionscript?
there are a lot of tutorials for AS out there and you should be able to translate them to LUA quite easily.

take a look at this:
http://www.constantlimit.com/site/wordpress/2007/12/29/codetorial-translating-the-tic-tac-toe-playing-board-to-flash-actionscript/

you should get the idea…

cheers,
-finefin [import]uid: 70635 topic_id: 12562 reply_id: 45933[/import]

Here’s a version of Tic Tac Toe in Lua for the Scite text editor. It doesn’t use the Corona APIs but the game logic should be readable and easy to translate.

http://lua-users.org/wiki/SciteTicTacToe
[import]uid: 1560 topic_id: 12562 reply_id: 45948[/import]

Thanks I will look at both of them!

Michelle [import]uid: 72372 topic_id: 12562 reply_id: 45950[/import]

Okay I looked at the items you guys listed and they are a little complicated to me. Can somebody help me with arrays on corona. I’m just not sure how to start. I know that’s what I would use for this.

Michelle [import]uid: 72372 topic_id: 12562 reply_id: 46085[/import]