SHARE
TWEET

Untitled

a guest Jan 14th, 2020 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. game =
  2. {   0, 0, 0,
  3.     0, 0, 0,
  4.     0, 0, 0
  5. }
  6.  
  7. function charOf(v)
  8.     if v == 0 then
  9.         return " "
  10.     end
  11.     if v == 1 then
  12.         return "X"
  13.     end
  14.     if v == 2 then
  15.         return "O"
  16.     end
  17.     return " "
  18. end
  19.  
  20. function draw()
  21.     a = {}
  22.     a[0] = "|" .. charOf(game[0]) .. "|" .. charOf(game[1]) .. "|" .. charOf(game[2]) .. "|"
  23.     a[1] = "|" .. charOf(game[3]) .. "|" .. charOf(game[4]) .. "|" .. charOf(game[5]) .. "|"
  24.     a[2] = "|" .. charOf(game[6]) .. "|" .. charOf(game[7]) .. "|" .. charOf(game[8]) .. "|"
  25.     return a
  26. end
  27.  
  28. function main()
  29.     print(draw()[0])
  30. end
  31. main()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top