Memory example
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Memory example
Hi friends,
found some very old stacks of mine on my HD today and thought I could share them here.
In the ZIP archive you will find two stacks:
1. simple_memory1.livecode
I used this stack for a demonstration at the European Revolution Conference (ERC) in Malta in 2004.
(For the youngsters, the former names of "Livecode" were "Runtime Revolution" and later just "Revolution"!)
It explains the LOGICS behind a memory game, so you understand what is going on in my scripting.
2. memory1.livecode
An actual memory game with timer etc.
The script can be used with ALL kind of memory games from two tiles (rather boring ) to an unlimited number of tiles.
Take a look and enjoy!
I saved the stacks in 2.4 format, so everyone should be able to open them.
Thanks to Klaus Junghans for the great cartoon pics!
Best
Klaus
found some very old stacks of mine on my HD today and thought I could share them here.
In the ZIP archive you will find two stacks:
1. simple_memory1.livecode
I used this stack for a demonstration at the European Revolution Conference (ERC) in Malta in 2004.
(For the youngsters, the former names of "Livecode" were "Runtime Revolution" and later just "Revolution"!)
It explains the LOGICS behind a memory game, so you understand what is going on in my scripting.
2. memory1.livecode
An actual memory game with timer etc.
The script can be used with ALL kind of memory games from two tiles (rather boring ) to an unlimited number of tiles.
Take a look and enjoy!
I saved the stacks in 2.4 format, so everyone should be able to open them.
Thanks to Klaus Junghans for the great cartoon pics!
Best
Klaus
- Attachments
-
- memory.zip
- (188.75 KiB) Downloaded 514 times
Re: Memory example
Interesting stuff Klaus. I did find I had one square with no mate (all others were cleared off), but still very nicely done
Re: Memory example
Strange, I played the memory a couple of times before I posted it here and all images where in place!?
If it happens again, could you please take a look if the button with the missing icon HAS infact an assigned icon?
Thanks!
If it happens again, could you please take a look if the button with the missing icon HAS infact an assigned icon?
Thanks!
Re: Memory example
I would be happy (if it happens again) to do anything I can to assist you Klaus
Nothing was missing a picture, btw, all the buttons (including the last one on the board) had pictures. The part that was missing was any more buttons, so I couldn't mate the last button to anything. I did find this doesn't happen all the time (6 attempts this morning), so maybe it was a fluke.
Joke time -
A programmer, an engineer, and a manager were riding through the Alps, when the brakes in their car failed and they careened down the mountains roads, nearly going over the edge several times before coming to a stop where they all got out of the car.
The manager said "We need to call a meeting, define our objectives, come to a solution, and initiate our plan! Who brought doughnuts and coffee?"
The engineer said "Look, I have my swiss army knife with me, I can rebuild the braking system in about 10 minutes and we can be on our way."
The programmer looks at both of them and says "Well, before we do anything else, I think we should drive it a little longer and see if it happens again, it might have just been a bug..."
Nothing was missing a picture, btw, all the buttons (including the last one on the board) had pictures. The part that was missing was any more buttons, so I couldn't mate the last button to anything. I did find this doesn't happen all the time (6 attempts this morning), so maybe it was a fluke.
Joke time -
A programmer, an engineer, and a manager were riding through the Alps, when the brakes in their car failed and they careened down the mountains roads, nearly going over the edge several times before coming to a stop where they all got out of the car.
The manager said "We need to call a meeting, define our objectives, come to a solution, and initiate our plan! Who brought doughnuts and coffee?"
The engineer said "Look, I have my swiss army knife with me, I can rebuild the braking system in about 10 minutes and we can be on our way."
The programmer looks at both of them and says "Well, before we do anything else, I think we should drive it a little longer and see if it happens again, it might have just been a bug..."
Re: Memory example
You mean you ended with on ONE button left?
Well, that MUST be a fluke
Well, that MUST be a fluke
Re: Memory example
Yah, that is my thinking as well. I haven't been able to reproduce it no matter how far I drove
-
- Posts: 128
- Joined: Thu Jun 30, 2016 3:08 am
Re: Memory example
Klaus,
This is nice. Thank you for posting it. I have a memory game in my current app-->sort of a little learning add on. It was done in javascript.It is not really necessary in the app, but some people enjoy it. Memory games were one of the pieces of the puzzle that I needed to see in order to find out if I could program a piece of one of my apps in LC.
BTW, I think that you have used very pretty colors. The characters are cute too.
Is it OK to dissect and also, maybe use some of the coding in my app? That is, if I need to use it? I might also like to ask questions (what else is new?) about the code.
So far, other than my lack of languages, the scripting makes perfect sense.
gezeigt = shown
Babelfish is my friend. Wish I could have been born a savant in many areas. Language is one. Alas...
-Rachel
This is nice. Thank you for posting it. I have a memory game in my current app-->sort of a little learning add on. It was done in javascript.It is not really necessary in the app, but some people enjoy it. Memory games were one of the pieces of the puzzle that I needed to see in order to find out if I could program a piece of one of my apps in LC.
BTW, I think that you have used very pretty colors. The characters are cute too.
Is it OK to dissect and also, maybe use some of the coding in my app? That is, if I need to use it? I might also like to ask questions (what else is new?) about the code.
So far, other than my lack of languages, the scripting makes perfect sense.
gezeigt = shown
Babelfish is my friend. Wish I could have been born a savant in many areas. Language is one. Alas...
-Rachel
May I never be cured of my curiosity!
Re: Memory example
Hi Rahel,
No, just kidding, do whatever you want to with the code.
Best
Klaus
just send me a gazillion bucks and there you go!Is it OK to dissect and also, maybe use some of the coding in my app? That is, if I need to use it?
No, just kidding, do whatever you want to with the code.
Sure, just ask.I might also like to ask questions (what else is new?) about the code.
Best
Klaus
-
- Posts: 128
- Joined: Thu Jun 30, 2016 3:08 am
Re: Memory example
@Bogs,
You are something else!
Now, on to another question:
In the game simple_memory1 stack, I see:
Should I be using empty commands like this in LC? I don't understand a lot about the memory game yet, but I did wonder about these empty commands in the mainStack.
-Rachel
You are something else!
Now, on to another question:
In the game simple_memory1 stack, I see:
Code: Select all
on preopenstack
##
end preopenstack
on openstack
##
end openstack
on preopencard
set the visible of fld "textd" to (the sprache of this stack = "d") //sprache means language in English
end preopencard
on opencard
##
end opencard
-Rachel
May I never be cured of my curiosity!
Re: Memory example
Hi Rachel,
to be honest, I have no idea why I put them there!?
That were my first steps in Metacard almost 20 years ago...
Best
Klaus
to be honest, I have no idea why I put them there!?
That were my first steps in Metacard almost 20 years ago...
Best
Klaus
Re: Memory example
Well, there are 3 reasons you might use a message handler (that I can think of).
1. You need something done when that message fires...
2. You are *planning* to do something when that message fires, but haven't worked out what exactly (same as inserting a TODO clause)...
3. You want to block that message from going farther.
4. There may be reasons I don't know yet
Since these are in the 'mainStack', it doesn't make sense to think they are 'blocking the messages', the message if it got this far is one step from the engine anyway (of course, there could still be reasons to stop it, just less likely at this point).
Now, I wasn't there when Klaus wrote this, and he has said that it was towards the beginning of his use of the language. Looking at the handlers listed, my guess would be he was trying that script in those handlers to see where it would work best, if it didn't work out as desired it was commented and moved, and finally settled on the 'preopencard' handler.
I could be WAY off on that guess, though
1. You need something done when that message fires...
2. You are *planning* to do something when that message fires, but haven't worked out what exactly (same as inserting a TODO clause)...
3. You want to block that message from going farther.
4. There may be reasons I don't know yet
Since these are in the 'mainStack', it doesn't make sense to think they are 'blocking the messages', the message if it got this far is one step from the engine anyway (of course, there could still be reasons to stop it, just less likely at this point).
Now, I wasn't there when Klaus wrote this, and he has said that it was towards the beginning of his use of the language. Looking at the handlers listed, my guess would be he was trying that script in those handlers to see where it would work best, if it didn't work out as desired it was commented and moved, and finally settled on the 'preopencard' handler.
I could be WAY off on that guess, though