Logo game help

Previous topic - Next topic

fuzzy70

I presume this is the right place to post this as technically not GLB related regarding coding etc.

As I am still learning GLB I thought that rather than browse through the commands writing little bits here & there, I would instead take the LOGO game tutorial & expand on it. For example do up the graphics, add sound,  title screen etc etc, that way I can pretty much use a lot of the graphics commands & others.

One of the features I thought of adding was some kind of scoring (along with a high score table for example) & one way I could implement that was get the computer to solve the puzzle & work out the minimum amount of clicks required to complete it. So as an example the bonus score is say 1000 points & the pc works out that 45 clicks is the minimum to solve it, for every click over 45 the bonus drops 100 points or something.

Writing the code to solve it will not a problem, the problem is (rather embarrassingly) that I cannot get my head around the tactic/strategy to solve the puzzle myself lol.

It's just one of those puzzles that I cannot figure out, the rules are so simple & more than likely the solution is as well but its just not popping in my head  :rant:. I done a search on the Amiga LOGO game which its based & drew a blank, even got the Amiga version & that's harder as it has a timer which counts down from 1 minute (seeing as I can spend 10mins & still not get past level 1 on the tutorial one the Amiga one does not help).

If anyone knows the tactic or if there is another name for that puzzle (can't really see the Amiga version being an original, but who know's) that I can search for that would be very much appreciated. I have saved the scoring system till last on my to-do list so no rush for answers & if no joy will have to think up another way to score the game, other than the amount of clicks it takes the player as it currently stands.

Cheers

Lee

I can understand if nobody replies for some time while they are busy ROFL at this  :noggin:
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Wampus

I'm not sure what LOGO is like to play and haven't seen the tutorial...but...sounds like the kind of problem that just has to be thought out carefully step by step and perhaps many times before one or more solutions become clear. Some might be quick, like a simple algorithm, while others may be slow, like searching through each possible move, discounting the ones that fail and continuing the search until the best possible route is found.

Ian Price

I'm not familiar with the game you mention (despite being into puzzles and the Amiga). Can you post some links and screenies? A video might help too.

Without knowing the game, I'm really sure exactly what you are asking for help with. How can you write code that will solve something if you yourself can't solve it?

I'm a dab hand with puzzle games and have written a fair few over the years (B'lox!, Guru Logic Champs, Sokoban, Ken2X, SuQo, CatTrap, Picross and several others) and have others in development - Puzzimals and Ootopia.

I'd be willing to help you out, but would need a bit more info first.



I came. I saw. I played.

erico

I would not know how to solve, but bumped into a similar problem when trying a top view race game...
how to make sure the AI cars comprehend the track and race? The track must be editable.

So maybe marking target point on the track? could be a core?

Really tough to do AI, but I find one of the most pleasurable things on programming when you do it.
I once wrote a streetfighter game, the opponent AI would look into it´s energy gauge so as yours and would also move between 3 distances from the player as to find the best attack approach, it was quite complex but easy in comparison to your problem.

I was so happy to see the AI taking choices and moving as it was alive... :'(

fuzzy70

Everybody who has GLB has a copy of the game, Open up the online help & select the 1st option (Tutorials) & its the one labelled "The First Game".

I have wrote code in the past that solves puzzles, but only when I knew how to solve them myself.

BTW I take no responsibility for any anger issues or frustration that may arise from you trying the game out  :D
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

fuzzy70

Quote from: Ian Price on 2011-Nov-02
Without knowing the game, I'm really sure exactly what you are asking for help with. How can you write code that will solve something if you yourself can't solve it?

My fault for not making myself too clear Ian. The help I require is in how I can solve the game. Once I know how to do it then I can program a routine that can work out the minimum amount of moves it can be achieved in.

Sorry  :noggin:

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Ian Price

Ahh, I know that game as "Lights Out" You basically place a symbol on the board (generally a 3x3 cross/diamond/square) - if an element of the board beneath the symbol was lit, then un-light it, otherwise light it. Once all lights are lit/unlit (depending on the original game aim) then the game/level is won.

It's a very simple concept and creating a routine where the pc can solve the puzzle shouldn't be too complex, although will require lots of recursion with the map data.

Info about the handheld game can be found here - http://en.wikipedia.org/wiki/Lights_Out_%28game%29
I came. I saw. I played.

fuzzy70

Quote from: Ian Price on 2011-Nov-02
Info about the handheld game can be found here - http://en.wikipedia.org/wiki/Lights_Out_%28game%29

Thanks Ian you are a Life saver  :nw: .

Know I now how to play it the pc solution to solving it is so easy its unreal. Basically it is the reverse order that the game plots each level & if the pc plots 5 items then 5 clicks are all that required to solve it.

Because I didn't understand the rules on how to play it originally (my mis-interpreting the help file) that was the cause of my problem :)
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Ian Price

D'oh - I was looking at it as if the computer didn't know how it plotted the lights (as if the puzzle was ported in to it).

Obviously if the computer plotted the puzzle then your solution is indeed correct and piss-easy.
I came. I saw. I played.

kanonet

No, if you dont change the NewLevel-sub, shortest solution is most times level+1. But not in every case, e.g. its possible that the computer 'clicks' two (or more) times in a row at the same position, in this case your the shortest solution is a smaller number. Of cause you can change the sub to prevent the computer from clicking on some position repentantly, but you should only prevent it, if none of the five fields, that belong to this position, got changed since the last click at this position.
Hope my English dont prevent you from understanding, what im trying to say. :S
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Ian Price

You are indeed correct and perfectly understandable :)

It is also possible that the computer clicks on the same space (non-consecutively (as opposed to your consecutively)) that has not been altered by other clicks, thereby negating itself. It would therefore be prudent to prevent this too, by preventing the computer from clicking on any space twice.
I came. I saw. I played.

kanonet

I would not completely prevent it from clicking same position twice:

If it clicks (3,4) -> (5,4) -> (3,4), it wont negate one click (think about the field (4,4)!), but would make the game bit more difficult and interesting. So i would allow it to do it this way. But of cause a (3,4) -> (6,8) -> (3,4) should be allowed.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Ian Price

You mis-read what I posted. I stated if any points of the original click "has not been altered by other clicks" - don't allow this.
I came. I saw. I played.

kanonet

Ah so we're saying the same. So lets hope it was useful for fuzzy. ;)

Btw the question how to solve this, if you dont know how it was created, is still interesting. I like thinking about creating AI, but its totally unnecessary in this case. That is an important lesson, that every (new) programmer has to learn: dont make things complicated!
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

fuzzy70

#14
Basically prevent it from doing the same position one after the other, nice & easy to do. If current random x/y = previous random x/y then roll again.

Like I said in my original post, expanding an existing "Basic" framework will allow me to learn GLB a lot better than just picking a command & playing with that. At least I will have a goal or target to use the commands with. Even if they only make it into the title screen or such I feel that a place will be found to use most the commands.

My main aim is to learn GLB features & syntax. common/basic loops, branching etc are pretty well under my belt from many years of basic programming  :good:

Quote from: kanonet on 2011-Nov-02
Ah so we're saying the same. So lets hope it was useful for fuzzy. ;)

It was very useful & thanks to all that posted, Especially Ian for the links so I understood how to play the game, I didn't quite get the idea of it from the help file lol
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)