Advertisement
Guest User

NES Pictionary - Answer Display

a guest
Mar 25th, 2018
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.39 KB | None | 0 0
  1. --Display Answer
  2. local x = 0
  3. local y = 10
  4. local i = 0
  5. local l = 0
  6. local lvalue = 0
  7.  
  8. function letter()
  9.     if lvalue==10 then
  10.         return ("A")
  11.     elseif lvalue==11 then
  12.         return ("B")
  13.     elseif lvalue==12 then
  14.         return ("C")
  15.     elseif lvalue==13 then
  16.         return ("D")
  17.     elseif lvalue==14 then
  18.         return ("E")
  19.     elseif lvalue==15 then
  20.         return ("F")
  21.     elseif lvalue==16 then
  22.         return ("G")
  23.     elseif lvalue==17 then
  24.         return ("H")
  25.     elseif lvalue==18 then
  26.         return ("I")
  27.     elseif lvalue==19 then
  28.         return ("J")
  29.     elseif lvalue==20 then
  30.         return ("K")
  31.     elseif lvalue==21 then
  32.         return ("L")
  33.     elseif lvalue==22 then
  34.         return ("M")
  35.     elseif lvalue==23 then
  36.         return ("N")
  37.     elseif lvalue==24 then
  38.         return ("O")
  39.     elseif lvalue==25 then
  40.         return ("P")
  41.     elseif lvalue==26 then
  42.         return ("Q")
  43.     elseif lvalue==27 then
  44.         return ("R")
  45.     elseif lvalue==28 then
  46.         return ("S")
  47.     elseif lvalue==29 then
  48.         return ("T")
  49.     elseif lvalue==30 then
  50.         return ("U")
  51.     elseif lvalue==31 then
  52.         return ("V")
  53.     elseif lvalue==32 then
  54.         return ("W")
  55.     elseif lvalue==33 then
  56.         return ("X")
  57.     elseif lvalue==34 then
  58.         return ("Y")
  59.     elseif lvalue==35 then
  60.         return ("Z")
  61.     else   
  62.         return ("")
  63. end
  64. end
  65.  
  66. while true do
  67.     while i<16 do
  68.         i=i+1
  69.         l=l+1
  70.         x=x+15
  71.         lvalue= memory.readbyte (0x447+l)
  72.         gui.text(x,y,letter())
  73.     --gui.text(x,y,str);
  74.     end
  75.     emu.frameadvance();
  76.     x = 0
  77.     i = 0
  78.     l = 0
  79.     lvalue = 0
  80. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement