Comparing identical values in Ruby
Posted: Sat Oct 18, 2014 6:55 am
Hi,
Once again, a Ruby challenge:
I need a simple ruby module with 1 in-1out floats that responds to the incoming data whenever a value is sent to it, even if the sent value has sent twice in raw. For instance, if i press a key that sends the float value "2" twice, the module should recognize that. On the first press, it should output "2", but on the second, it should output "3", if any other new key is pressed ( even if its "2" again!) after the the double press, then it will output the new value, untill this value is double-pressed again. Any suggestion?
Once again, a Ruby challenge:
I need a simple ruby module with 1 in-1out floats that responds to the incoming data whenever a value is sent to it, even if the sent value has sent twice in raw. For instance, if i press a key that sends the float value "2" twice, the module should recognize that. On the first press, it should output "2", but on the second, it should output "3", if any other new key is pressed ( even if its "2" again!) after the the double press, then it will output the new value, untill this value is double-pressed again. Any suggestion?