Advertisement
BobMe

tic-tac-toe thing

Sep 6th, 2019
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. local tic = {1,0,2,2,1,2,2,2,1}
  2.  
  3. function tictotac(x)
  4. if x == 0 then
  5. return " "
  6. elseif x == 1 then
  7. return "x"
  8. elseif x == 2 then
  9. return "o"
  10. end
  11. end
  12.  
  13.  
  14. print(" "..tictotac(tic[1]).." | "..tictotac(tic[2]).." | "..tictotac(tic[3]).." \n———+———+———\n "..tictotac(tic[4]).." | "..tictotac(tic[5]).." | "..tictotac(tic[6]).." \n———+———+———\n "..tictotac(tic[7]).." | "..tictotac(tic[8]).." | "..tictotac(tic[9]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement