From: Julian Fondren Date: 1998-12-18T14:20:09-06:00 Subject: [ruby-talk:00122] Re: finished simple script > Hi! > > In message "[ruby-talk:00120] finished simple script" > on 98/12/17, Julian Fondren writes: > > >#!/usr/bin/env/ruby > >print "Input two numbers to multiply together: \n" > >ans1, ans2 = STDIN.gets.chomp.scan(/\d+/).collect { |x| x.to_i } > > > >while !ans1 > > if !ans1 > > ans1, ans2 = STDIN.gets.to_i, STDIN.gets.to_i > > end > >end > >while !ans2 > > if !ans2 > > ans2 = STDIN.gets.to_i > > end > >end > > >curiously, ``.'' is translated to an integer as ``32'' > > Humm... I can't find such situation for the above script :-( > Would you tell me what input shows that ``.'' is translated to 32, > or explain me the reason why you think so? I don't know. Yesterday 1 * . gave 32.. but then yesterday this script also allowed me to press enter 2000 times, 1, enter 2000 times, 2 and get the answer of 2. Strange. > -- gotoken > > # private note: > # I'm now considering your correction yet. sorry for delaying. > Julian >