Method: Rubytris::Field#write
- Defined in:
- lib/rubytris/field.rb
#write ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/rubytris/field.rb', line 67 def write() text = "\n\e[25D" @field.each do |line| line.each do |l| if l == FieldStatus::NONE text += NONE_CHAR elsif l == FieldStatus::ACTIVE || l == FieldStatus::FIX text += BLOCK_CHAR else text += WALL_CHAR end end text += "\n\e[25D" end puts text end |