[Script] Tic Tac Toe |
Baasbase « Citoyen » 1381160700000
| 0 | ||
Tic tac toe is finally available in TFM. This script can be used as a tribe house script, it gets boring very fast though! I hope you can learn from this, I have programmed it in a simplistic way and just looking at the functions should be enough to understand how this script works. If you have any questions, feel free to ask them! PS: It doesnt detect when there is a winner, it would be not too hard to implement that but I didn't feel like doing it, maybe one of you can add that? PPS: !new starts a new game, !stop will quit the script and using !new playername will change your current opponent with the playername you specified (for example !new Tigrounette would put me against Tigrounette in a new match) PPPS: When loading this script you have to manually change the players who will first participate, its at the top of the script :) Baasbase a dit : Enjoy! |
Unicorm « Citoyen » 1381161060000
| 0 | ||
omg *-* is it possible to have more than two players? edit: is it possible to have a larger grid? v that's too bad ;-; |
Haruhitastic « Censeur » 1381161300000
| 0 | ||
have you ever played a round of tic tac toe where you've had more than two? that'd gonna be new to me if so. :P (aka: no, likely not.) |
Mikuhl « Citoyen » 1381161840000
| 0 | ||
psst: you can use ' for the XML instead of using two characters to escape the quotation. |
Foorero « Citoyen » 1381162860000
| 0 | ||
|
Ordboka « Citoyen » 1381164660000
| 0 | ||
Nice code. Figured I could give the winning mechanism a shot. Here it goes Lua a dit : It's very simple, and could probably be improved. If you find any bugs please tell me or fix it yourself and post the code here for everyone to see! |
0 | ||
edited |
Shamousey « Consul » 1381165260000
| 0 | ||
I'm curious, why did you escape every single " instead of just using ' or [[...]]? a dit : |
Baasbase « Citoyen » 1381165680000
| 0 | ||
matter of habit (programming background in java) |
Gilcatmey « Citoyen » 1381170900000
| 0 | ||
I can't copy the full code from the forum :( |
Tranna « Citoyen » 1381171440000
| 0 | ||
How not? On the forum post, click CTRL+A then post in /lua tab, remove uneeded things like the end and the beginning and.. simple! |
Gilcatmey « Citoyen » 1381171800000
| 0 | ||
Tranna a dit : Thanks! I was pressing CTRL+E instead xD But now I pasted it but nothing happened, it happens always I try a script |
Tranna « Citoyen » 1381172220000
| 0 | ||
Do you have permission to use the /np command? |
Gilcatmey « Citoyen » 1381172340000
| 0 | ||
Yes, I'm sub-leader actually |
Haruhitastic « Censeur » 1381177320000
| 0 | ||
Is it possible that bogus hack ban is ruining it? :[ You can't use /lua if you've received a ban for hacking. |
Xxninjazxx « Citoyen » 1381181040000
| 0 | ||
Now someone code celebrity squares with this. |
Gilcatmey « Citoyen » 1381191540000
| 0 | ||
Haruhitastic a dit : Wow, that'd be the reason... |
Nathaan « Citoyen » 1381245540000
| 0 | ||
Good game for the code ! ;D |
0 | ||
I can't use it! I've copied it but the code is too long so I have to take piece to piece but I always get messed up! :( |
Mikuhl « Citoyen » 1381366260000
| 0 | ||
Swirlfire a dit : You cant copy the whole thing? What computer are you using, a toaster? |