Hi.
ok. My mistake. You are right. Youre version works.
In the original version from me, the snake starts immediadly. In your version, you have to press a movement key first, otherwise it waits in the middle.
And I was using cursor keys in KBD mode, not wasd keys. Therefore, I thought, it is not working.
Thanks again, for the explanation. So snake might now be an very simple example of using conio.h and game movement without waiting for key input.
(Working source attached again)
best, Peter
glcc: some simple c source as play ground
Forum rules
Be nice. No drama.
Be nice. No drama.
Re: glcc: some simple c source as play ground
- Attachments
-
- snake.c
- (2.63 KiB) Downloaded 380 times
Re: glcc: some simple c source as play ground
Yes. lastkey logic was required.
Here is an updated snake.c with lastkey logic.
best, Peter
Here is an updated snake.c with lastkey logic.
best, Peter
- Attachments
-
- snake.c
- (2.6 KiB) Downloaded 390 times
Re: glcc: some simple c source as play ground
So here is another game 'Atom / Chain Reaction' using conio with a quick fix to make it work under glcc+Gigatron.
Game Play: https://learncgames.com/tutorials/atoms ... -tutorial/
Original Source: https://github.com/David-H-Bolton/LearnCCode/tree/main
Conio used for linux/macos: https://github.com/casualsnek/linuxconio/tree/main
In the zip file:
v0 = original source using local conio.h from above side: cc atoms.c -o atoms (Mac OS Ventura)
v1 = working Gigatron version - same as on main directory as a safe place.
Have fun playing, making it better (eg: no scrolling; using colors..) whatsoever![Wink ;-)](./images/smilies/icon_e_wink.gif)
best, Peter
Game Play: https://learncgames.com/tutorials/atoms ... -tutorial/
Original Source: https://github.com/David-H-Bolton/LearnCCode/tree/main
Conio used for linux/macos: https://github.com/casualsnek/linuxconio/tree/main
In the zip file:
v0 = original source using local conio.h from above side: cc atoms.c -o atoms (Mac OS Ventura)
v1 = working Gigatron version - same as on main directory as a safe place.
Have fun playing, making it better (eg: no scrolling; using colors..) whatsoever
![Wink ;-)](./images/smilies/icon_e_wink.gif)
best, Peter
- Attachments
-
- Bildschirmfoto 2023-08-06 um 19.17.51.png (41.59 KiB) Viewed 3434 times
-
- atoms.zip
- (30.43 KiB) Downloaded 380 times
Re: glcc: some simple c source as play ground
One of my GLCC tests is now a rewritten variant of snake.
I also have a good conio emulation for unix (in the unix directory).
Just "make snake" for unix, "make TSTsnake.gt1" for gigatron.
- Leon
https://github.com/lb3361/gigatron-lcc/ ... tuff/conio
I also have a good conio emulation for unix (in the unix directory).
Just "make snake" for unix, "make TSTsnake.gt1" for gigatron.
- Leon
https://github.com/lb3361/gigatron-lcc/ ... tuff/conio
- Attachments
-
- TSTsnake.gt1
- (4.62 KiB) Downloaded 378 times
Last edited by lb3361 on 09 Aug 2023, 05:15, edited 1 time in total.
Re: glcc: some simple c source as play ground
Very nice improvement! Many Thx.
best, Peter
best, Peter
- Attachments
-
- TSTsnake.gt1
- (6.49 KiB) Downloaded 391 times
-
- Bildschirmfoto 2023-08-08 um 13.55.20.png (39.03 KiB) Viewed 3399 times
Re: glcc: some simple c source as play ground
I apologize upfront - but I could not resist.
I know - nobody needs Eliza - but here it is adapted for Gigatron 64k required.![Wink ;-)](./images/smilies/icon_e_wink.gif)
Source from here:
https://github.com/mottosso/cs50x/blob/master/eliza.c
(In the Mac Emu, it does NOT run - only black screen?. In gtemuAT67 it runs fine)
best, Peter
I know - nobody needs Eliza - but here it is adapted for Gigatron 64k required.
![Wink ;-)](./images/smilies/icon_e_wink.gif)
Source from here:
https://github.com/mottosso/cs50x/blob/master/eliza.c
(In the Mac Emu, it does NOT run - only black screen?. In gtemuAT67 it runs fine)
best, Peter
- Attachments
-
- LICENSE.txt
- (1.06 KiB) Downloaded 376 times
-
- Bildschirmfoto 2023-08-09 um 19.57.40.png (47 KiB) Viewed 3379 times
-
- eliza64.gt1
- (10.5 KiB) Downloaded 388 times
-
- eliza.c
- (12.04 KiB) Downloaded 384 times
Re: glcc: some simple c source as play ground
Simple 2048 game.
Original Source from here: https://gist.github.com/ibaned/41481b2fdddbb61a4291
Now runs on Gigatron
Use wasd for movements.
Lot of improvements possible![Wink ;-)](./images/smilies/icon_e_wink.gif)
best, Peter
Original Source from here: https://gist.github.com/ibaned/41481b2fdddbb61a4291
Now runs on Gigatron
![Wink ;-)](./images/smilies/icon_e_wink.gif)
Lot of improvements possible
![Wink ;-)](./images/smilies/icon_e_wink.gif)
best, Peter
- Attachments
-
- Bildschirmfoto 2023-08-10 um 12.50.40.png (38.82 KiB) Viewed 3355 times
-
- 2048.zip
- (17.06 KiB) Downloaded 384 times
Re: glcc: some simple c source as play ground
Some more simple c code examples.
This time "Enigma".
The crypto machine used in WW2 by german army.
Links:
https://en.wikipedia.org/wiki/Enigma_machine
https://www.codeproject.com/Articles/831015/ENIGMA
Some simple c code used here and found at:
https://github.com/timlindquist/Enigma/tree/master
Could be improved by showing rotating wheels etc. pp;-)
Have fun, Peter
This time "Enigma".
The crypto machine used in WW2 by german army.
Links:
https://en.wikipedia.org/wiki/Enigma_machine
https://www.codeproject.com/Articles/831015/ENIGMA
Some simple c code used here and found at:
https://github.com/timlindquist/Enigma/tree/master
Could be improved by showing rotating wheels etc. pp;-)
Have fun, Peter
- Attachments
-
- enigma.png (50.36 KiB) Viewed 2767 times
-
- enigma.zip
- (39.39 KiB) Downloaded 335 times