This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Csstform's profile picture

Remembrance

Started by Csstform, 03 February 2014 - 11:37 AM
Csstform #1
Posted 03 February 2014 - 12:37 PM
REMEMBRANCE
=========================================================

Hello, ComputerCraft community!

This is a quick project I put together on a whim: Tell me what you think.

Sorry for the limited pics, any more would be spoilers/cheats!
[media]
http://i.imgur.com/lmRRFXF.png
[/media]

This game will test your memory, and cause you to think. I created it as a test of the colors api. If you enjoy this, tell me and I will make more levels.


pastebin get 8qGGXr8R
MUST BE RUN ON A ADVANCED COMPUTER!
Edited on 04 February 2014 - 09:05 AM
Bomb Bloke #2
Posted 03 February 2014 - 07:04 PM
Sorry, that doesn't appear to be a valid paste.
Csstform #3
Posted 04 February 2014 - 10:05 AM
Thanks, the link is fixed.
Bomb Bloke #4
Posted 04 February 2014 - 06:13 PM
read() halts the script until the user presses "enter", specifically (as opposed to "any key"). os.pullEvent("key") waits until any key press, while os.pullEvent("char") waits for one that can be represented as an on-screen character.

For eg, instead of:

ans1 = read()

You might use:

__,ans1 = os.pullEvent("char")

You could shrink things down a fair bit by making better use of your "drawBackground()" function - why should all your other screen patterns include the border when that's already drawn it for you?

I recommend looking into "for" loops next, then tables.

I scored 4/5 by answering the last question incorrectly.
Csstform #5
Posted 04 February 2014 - 08:30 PM
Thank you for your input - I wil look into those things.
awsmazinggenius #6
Posted 04 February 2014 - 10:02 PM
Tables complement for loops a lot thanks to the pairs() iteration function. I recommend learning the numeric for, then tables, then the generic for in that order.
wolfboyft #7
Posted 13 March 2014 - 05:38 PM
Nice, but… short…