MC logo

CSc 232 Ruby Assignment 1

^  CSc 232 Ruby Assignments

45 pts

Take It Out

Due: Feb 6, 2007

Write a ruby program which prompts for and reads one line of input. It then echos the line, then prints it repeatedly, each time removing every second character. It continues until no more characters can be removed. Treat all characters alike; no special treatment for spaces or punctuation. Like this:

tom@laptop:~/courses/ruby/asst$ ruby reduce.rb
Please enter a line> Sandy.
Sandy.
Sny
Sy
S
tom@laptop:~/courses/ruby/asst$ ruby reduce.rb
Please enter a line> On Tuesday, Frank in the motor pool buys lunch.
On Tuesday, Frank in the motor pool buys lunch.
O usa,Faki h oo olby uc.
OuaFk  oob c
Oak o
Oko
Oo
O
tom@laptop:~/courses/ruby/asst$ ruby reduce.rb
Please enter a line> Those so aglow point at hues afferent
Those so aglow point at hues afferent
Toes go on the feet
Te oo h et
T ohe
Toe
Te
T

Submission

When your program works and is properly indented and commented, submit it here.