Computer Science Canada

Hasch Key reading

Author:  vertdragon23 [ Wed Jan 08, 2014 11:11 pm ]
Post subject:  Hasch Key reading

What is it you are trying to achieve?
I want to know how to read a specific key instead of all keys. I know it involves using the ascii code of the key.


What is the problem you are having?
I can't seem to remember, I used to know how to do this.


Describe what you have tried to solve this problem
<I have tried turing reference.>


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>

Turing:


<var ch:string(1)

loop
if hasch

getch(c)

end if
end loop >



Please specify what version of Turing you are using
<4.1.1 (latest)>

Author:  Raknarg [ Wed Jan 08, 2014 11:41 pm ]
Post subject:  RE:Hasch Key reading

you mean something like this?
Turing:

var ch : string(1)

loop
    if hasch then
        getch (ch)
        if ch = "c" then
            put "You pressed c"
        else
            put "You didn't press c"
        end if
    end if
end loop

Author:  vertdragon23 [ Thu Jan 09, 2014 11:08 pm ]
Post subject:  RE:Hasch Key reading

Thanks Raknarg, I can't believe I forgot how to do something as simple as that.


: