JJXB

scr_txt_read

May 8th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //scr_txt_read
  2. //read from text file with random number
  3. exedir=working_directory;
  4. puzzlefile=string(irandom_range(1,2)) + ".txt";
  5. puzzledir=string(exedir)+"\puzzle\"+string(puzzlefile);
  6. puzzleopen = file_text_open_read(puzzledir);
  7. //setting initial line for array_read
  8. vblock = 1
  9. hblock = 1
  10. //
  11. do
  12. {global.array_read[vblock]=file_text_read_real(puzzleopen)
  13. vblock +=1
  14. file_text_readln(puzzleopen);
  15. } until(file_text_eof(puzzleopen));
  16. file_text_close(puzzleopen);
  17. vblock = 1
  18. do {
  19. global.array_grid[hblock,vblock] = string_char_at(hblock,global.array_read[vblock])
  20. vblock +=1
  21. hblock +=1
  22. } until hblock=9 and vblock=9 {}
Advertisement
Add Comment
Please, Sign In to add comment