xXm0dzXx

Untitled

Nov 18th, 2012
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. local x,y = term.getSize()
  2.  
  3. tChars = { "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z" }
  4. tWords = {}
  5.  
  6. print("Enter the path to a word list (a file with a word on each line)")
  7. write("Path: /")
  8. path = read()
  9. if fs.exists( path ) then
  10. file = fs.open( path, "r" )
  11. if file then
  12. line = file.readLine()
  13. while line do
  14. tWords[#tWords+1] = line
  15. line = file.readLine()
  16. end
  17.  
  18. file.close()
  19. else
  20. error("Y U NO SELECT A REAL FILE?!?!?!?!?")
  21. end
  22. else
  23. error("Y U NO SELECT A FILE?!??!")
  24. end
  25.  
  26. function drawWords()
  27. for i=1,x do
  28. for z=1,y do
  29. term.setCursorPos(i,z)
  30. write( tChars[ math.random( #tChars ) ] )
  31. end
  32. end
  33.  
  34. for i=1,#tWords do
  35. repeat
  36. randomStart = math.random( x )
  37. until (tWords[ i ] + randomStart) < x
  38.  
  39. term.setCursorPos( randomStart, math.random( y ) )
  40. end
  41. end
  42.  
  43. drawWords()
  44. sleep(126000)
Advertisement
Add Comment
Please, Sign In to add comment