Guest User

Untitled

a guest
Oct 15th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. f = File.readlines("shading.txt")
  2. $i = 0
  3. $switch = 0
  4.  
  5. open('shading_out.txt','a'){|g|
  6. while $i < f.size do
  7. if f[$i] == f[$i+1]
  8. g.puts ($switch).even?.to_s
  9. else
  10. if $i == (f.size-1)
  11. $switch-=1
  12. g.puts ($switch).even?.to_s
  13. else
  14. g.puts ($switch).even?.to_s
  15. $switch+=1
  16. end
  17. end
  18. $i += 1
  19. end
  20. }
Advertisement
Add Comment
Please, Sign In to add comment