logoalt Hacker News

curtisblainetoday at 9:17 PM0 repliesview on HN

> If A = −1: Read one keypress from the human operator and place a number representing it into slot[B]. (If no key is pressed, place 0.)

> If B = −1: Display slot[A] as one character of text to the human operator.

This is not well specified imho:

1) What if both A and B are -1? I can't do any of the two, or I would read / write an invalid slot (since slots indexes are >= 0)

2) What does "Read a keypress" mean? Should I wait for the operator to press a key? In that case, how can no key be pressed? Timeout? Or should I just check if a key is already pressed when the instruction is executed?