SHARE
TWEET

Untitled

a guest Apr 26th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function generateLetter(letter)
  2.     array = {}
  3.  
  4.     for i=1,3 do
  5.        array[i] = {}       
  6.        for j=1,5 do
  7.           array[i][j] = i*j
  8.        end     
  9.     end
  10.    
  11.     for i=1,3 do
  12.        for j=1,5 do
  13.           array[i][j] = true
  14.        end
  15.     end
  16.    
  17.     --position 1 1
  18.     if(letter == 1 or letter == 3 or letter == 13 or letter == 14 or letter == 22 or letter == 23 or letter == 24)
  19.     then
  20.         array[1][1] = false
  21.     end
  22.    
  23.     --position 2 1
  24.     if(letter == 8 or letter == 11 or letter == 12 or letter == 13 or letter == 14 or letter == 21 or letter == 22 or letter == 23 or letter == 24 or letter == 25)
  25.     then
  26.         array[2][1] = false
  27.     end
  28.    
  29.     --position 3 1
  30.     if(letter == 1 or letter == 2 or letter == 3 or letter == 4 or letter == 12 or letter == 13 or letter == 14 or letter == 22 or letter == 23 or letter == 24)
  31.     then
  32.         array[3][1] = false
  33.     end
  34.    
  35.     --position 1 2
  36.     if(letter == 9 or letter == 10 or letter == 20 or letter == 24 or letter == 26)
  37.     then
  38.         array[1][2] = false
  39.     end
  40.    
  41.     --position 2 2
  42.     if(letter ~= 9 and letter ~= 10 and letter ~= 20)
  43.     then
  44.         array[2][2] = false
  45.     end
  46.    
  47.     --position 3 2
  48.     if(letter == 5 or letter == 6 or letter == 9 or letter == 10 or letter == 12 or letter == 14 or letter == 19 or letter == 20 or letter == 24)
  49.     then
  50.         array[3][2] = false
  51.     end
  52.    
  53.     --position 1 3
  54.     if(letter == 9 or letter == 10 or letter == 20 or letter == 25)
  55.     then
  56.         array[1][3] = false
  57.     end
  58.    
  59.     --position 2 3
  60.     if(letter == 3 or letter == 4 or letter == 12 or letter == 15 or letter == 21 or letter == 22 or letter == 23 or letter == 24)
  61.     then
  62.         array[2][3] = false
  63.     end
  64.    
  65.     --position 3 3
  66.     if(letter == 2 or letter == 3 or letter == 5 or letter == 6 or letter == 9 or letter == 10 or letter == 11 or letter == 12 or letter == 18 or letter == 20 or letter == 25)
  67.     then
  68.         array[3][3] = false
  69.     end
  70.    
  71.     --position 1 4
  72.     if(letter == 7 or letter == 9 or letter == 10 or letter == 17 or letter == 19 or letter == 20 or letter == 24 or letter == 25)
  73.     then
  74.         array[1][4] = false
  75.     end
  76.    
  77.     --position 2 4
  78.     if(letter ~= 9 and letter ~= 10 and letter ~= 20 and letter ~= 23 and letter ~= 24 and letter ~= 25)
  79.     then
  80.         array[2][4] = false
  81.     end
  82.    
  83.     --position 3 4
  84.     if(letter == 5 or letter == 6 or letter == 9 or letter == 10 or letter == 12 or letter == 16 or letter == 20 or letter == 24 or letter == 25 or letter == 26)
  85.     then
  86.         array[3][4] = false
  87.     end
  88.    
  89.     --position 1 5
  90.     if(letter == 3 or letter == 17 or letter == 20 or letter == 22 or letter == 25)
  91.     then
  92.         array[1][5] = false
  93.     end
  94.    
  95.     --position 2 5
  96.     if(letter == 1 or letter == 6 or letter == 8 or letter == 11 or letter == 13 or letter == 14 or letter == 16 or letter == 17 or letter == 18 or letter == 23 or letter == 24)
  97.     then
  98.         array[2][5] = false
  99.     end
  100.    
  101.     --position 3 5
  102.     if(letter == 2 or letter == 3 or letter == 4 or letter == 6 or letter == 10 or letter == 16 or letter == 20 or letter == 22 or letter == 25)
  103.     then
  104.         array[3][5] = false
  105.     end
  106.    
  107.     if(letter == 27)
  108.     then
  109.         for i=1,3 do
  110.            for j=1,5 do
  111.               array[i][j] = false
  112.            end
  113.         end
  114.     end
  115.    
  116.     return array
  117. end
  118.  
  119. letters = {}
  120.  
  121. for i=1,27 do
  122.     letters[i] = generateLetter(i)
  123. end
  124.  
  125.  
  126. function printLetters(which)
  127.     print(letters[which][1][1] .. letters[which][2][1] .. letters[which][3][1] .. "\n" .. letters[which][1][2] .. letters[which][2][2] .. letters[which][3][2] .. "\n" .. letters[which][1][3] .. letters[which][2][3] .. letters[which][3][3] .. "\n" .. letters[which][1][4] .. letters[which][2][4] .. letters[which][3][4] .. "\n" .. letters[which][1][5] .. letters[which][2][5] .. letters[which][3][5])
  128. end
  129.  
  130.  
  131. function outOfBlocks()
  132.     if(turtle.getItemCount == 0)
  133.     then
  134.         if(turtle.getSelectedSlot() < 16)
  135.         then
  136.             turtle.select(turtle.getSelectedSlot() + 1)
  137.         end
  138.     end
  139. end
  140.  
  141. function buildLetter(letter)
  142.     local x,y = 1,5
  143.     turtle.down()
  144.     turtle.down()
  145.     turtle.down()
  146.     turtle.down()
  147.     turtle.down()
  148.     for i=1, 5 do
  149.         if(letters[letter][x][y])
  150.         then
  151.             turtle.placeDown()
  152.             outOfBlocks()
  153.         end
  154.         x = 2
  155.         turtle.forward()
  156.         if(letters[letter][x][y])
  157.         then
  158.             turtle.placeDown()
  159.             outOfBlocks()
  160.         end
  161.         x = 3
  162.         turtle.forward()
  163.         if(letters[letter][x][y])
  164.         then
  165.             turtle.placeDown()
  166.             outOfBlocks()
  167.         end
  168.         y = y - 1
  169.         turtle.up()
  170.        
  171.         turtle.back()
  172.         turtle.back()
  173.         x = 1
  174.     end
  175. end
  176.  
  177.  
  178. word = "hello"
  179. word = string.lower(word)
  180. length = string.len(word)
  181.  
  182. turtle.select(1)
  183. turtle.refuel()
  184. turtle.up()
  185. turtle.up()
  186. turtle.up()
  187. turtle.up()
  188. turtle.up()
  189. turtle.forward()
  190. turtle.select(2)
  191.  
  192. for i = 1, length, 1 do
  193.     letter = string.byte(word, i) - 96
  194.     if(letter >= 1 and letter <= 27)
  195.     then
  196.         printLetters(letter)
  197.         print()
  198.         buildLetter(letter)
  199.         for i=1, 5 do
  200.             turtle.forward()
  201.         end
  202.     end
  203. end
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