From: Ray DarkScythe Date: 2011-10-24T14:23:13+09:00 Subject: ASCII character help! Hi, I am new to ruby and following some tutorial of "Daniel Carrera" i already finish this overall tutorial answered the exercise and now just reviewing the lesson. here is the exercise that bothering me: I understand the lesson conditional that (equal, greter than and so on...) the "a" > "R" = true 1.Re-arrange these characters in ASCIIbetical order: 2, u, A, 4, w, f, R, y here is my answer: I attach the rb file if you want to run it in command line. puts "type this:" + "2" + "u"+ "A" + "4" + "w" + "f" + "R" + "y" asci = gets.chomp.to_s if asci =="2uA4wfRy" else asci != "2uA4wfRy" puts "retype this:" + "2" + "u"+ "A" + "4" + "w" + "f" + "R" + "y" asci = gets.chomp.to_s end until asci == "2uA4wfRy" #recycle if wrong input, I put this for fun puts "2, 4, A, R, f, u, w, y" I am not really sure if this is what the question looking for? I think it is looking for a automated ascii alphabetically (you know the math thing). 2.The ASCII table contains all the characters in the keyboard. Use irb to find out wheter the characters "?" lies: 1. Before 0. #what lies he is looking for here.. I know how to use Irb 2. After 9 but before A. 3. After Z but before a. 4. After z. .....I check the ascii table so "Before 0" is this "/" =/ this is his number....After 9 is this ":" and before A is this "@" character, do my understanding correct? 3.Using your experience the previous question, make a program that accepts a character input and tells you if the character lines: Before 0. After 9 but before A. After Z but before a. After z. Then try the program with the following characters: $, +, ?, <, -, ~, :, %, ^, {, [ Sample answers: $ lies before 0 #...why $ this lies before 0? confusing... < lies between 9 and A - lies between Z and a ~ lies after z ...Now i don't get it or confuse, I know to input the "gets" method and the conditional method. here is the site of that exercise, scroll down at the bottom. http://localdoc.scusa.lsu.edu/ruby/Tutorial/part_02/conditionals.html Thanks for someone answering this question Attachments: http://www.ruby-forum.com/attachment/6700/asci.rb -- Posted via http://www.ruby-forum.com/.