1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-12-23 23:30:22 +00:00

Add readkeytest example

This commit is contained in:
Karol Stasiak 2020-03-31 18:58:19 +02:00
parent 1f626b0666
commit 353923d3bc
2 changed files with 16 additions and 1 deletions

View File

@ -11,7 +11,7 @@ If you are using a release version of the compiler, consider browsing the older
## Cross-platform examples
* [Hello world](crossplatform/hello_world.mfk) (C64/C16/PET/VIC-20/PET/Atari/Apple II/BBC Micro/ZX Spectrum/PC-88/Armstrad CPC/MSX) simple text output
* [Hello world](crossplatform/hello_world.mfk) (C64/C16/PET/VIC-20/Atari/Apple II/BBC Micro/ZX Spectrum/PC-88/Armstrad CPC/MSX) simple text output
* [Fizzbuzz](crossplatform/fizzbuzz.mfk) (C64/C16/PET/VIC-20/PET/Atari/Apple II/BBC Micro/ZX Spectrum/PC-88/Armstrad CPC/MSX/X16) everyone's favourite programming task
@ -29,6 +29,8 @@ If you are using a release version of the compiler, consider browsing the older
* [Fire effect](crossplatform/fire.mfk) (C64/C16/ZX Spectrum) a simple fire effect
* [`readkey` test](crossplatform/readkeytest.mfk) (C64/C16/PET/VIC-20/Atari/Armstrad CPC/ZX Spectrum/PC-88) keyboard reading test
* [Screen encoding test](crossplatform/screnctest.mfk) (C64/C16) default-to-screen encoding conversion test
* [Bell](crossplatform/bell.mfk) (Apple II/ZX Spectrum) a program that goes \*ding!\*

View File

@ -0,0 +1,13 @@
import stdio
import keyboard
void main() {
byte c
ensure_mixedcase()
while true {
c = readkey()
putchar(c)
putchar(hi_nibble_to_hex(c))
putchar(lo_nibble_to_hex(c))
putchar(' ')
}
}