Can you beat my game?

Community Forums/Showcase/Can you beat my game?

nawi(Posted 2006) [#1]
No exe, compile it yourself:

Very simple game, I'm not sure how to beat it. You click the array and you can only move like the horse moves in the chess game. F2 resets the game.

My high score is 42
AppTitle "Small game by nawitus - F2 to restart"

Dim Map(8,8)

Map(4,4) = 1
Global C=1,lastx=4,lasty=4

Graphics 288,288,0,2


Repeat

	Rect 0,0,96,96,1
	Rect 0,192,96,96,1
	Rect 192,0,96,96,1
	Rect 192,192,96,96,1

	For x=0 To 8
		For y=0 To 8
			Rect x*32,y*32,32,32,0
			If Map(x,y) Then Text x*32+10,y*32+10,Map(x,y)
		Next
	Next

	If MouseHit(1) Then
		mx=MouseX():my=MouseY()
		tx = Floor(mx/32)
		ty = Floor(my/32)
		If (tx>-1) And (ty>-1) And (tx<9) And (ty<9)
			If Map(tx,ty) = 0
				If Not(tx<3 And ty<3)
				If Not(tx>5 And ty>5)
				If Not(tx<3 And ty>5)
				If Not(tx>5 And ty<3)
				If check(tx,ty)
				C=c+1
				Map(tx,ty) = C
				lastx=tx
				lasty=ty
				EndIf
				EndIf
				EndIf
				EndIf
				EndIf
			EndIf
		EndIf
	EndIf
	
	If KeyHit(60)
		For x=0 To 8
			For y=0 To 8
				Map(x,y)=0	
			Next
		Next
		C=1
		Map(4,4)=1
		lastx=4
		lasty=4
	EndIf


	Flip
	Cls


Until KeyHit(1)

Function Check(tx,ty)
	If (Abs(lastx-tx) = 2) And (Abs(lasty-ty)=1) Return 1
	If (Abs(lastx-tx) = 1) And (Abs(lasty-ty)=2) Return 1
End Function



puki(Posted 2006) [#2]
I got 36 on my first go.


Grey Alien(Posted 2006) [#3]
Maybe you should say it's BPlus code. Anyway here's a BMax conversion:




deps(Posted 2006) [#4]
My best score was 28


Gabriel(Posted 2006) [#5]
I got 42, same as you. That's the best I can do.


Mikele(Posted 2006) [#6]
Nice game :). I got 42.


AJirenius(Posted 2006) [#7]
36 on first as well
nice small game :D


Fuller(Posted 2006) [#8]
40 on second try. Pretty interesting game. Seems like something that would be on one of those "test your brain power" quizzes.


Neuro(Posted 2006) [#9]
Intresting game, simple concept too. I will not however, post my embarassing low score though...


Grey Alien(Posted 2006) [#10]
42 on first go, had 3 squares empty. I just went in spirals.


LarsG(Posted 2006) [#11]
weee.. got 42 myself..don't know if it's possible to get more.


flounder22001(Posted 2006) [#12]
41 :(


Subirenihil(Posted 2006) [#13]
38 on first try, 42 on second :)
trying for more...

Different solution for 42...


Andy_A(Posted 2006) [#14]
aaargh, can't get past 40 :(


DarkMere(Posted 2006) [#15]
I got 45!..... I GOT 45!!!!!

But only in my dreams. :) No matter how many times I have tried, I cannot get past 41


rdodson41(Posted 2007) [#16]
Cool game, why is it so slow?


nawi(Posted 2007) [#17]
What do you mean slow?


Grey Alien(Posted 2007) [#18]
When you click it takes a while for anything to appear, it's pig slow in fact.


Andy_A(Posted 2007) [#19]
Runs just fine here even in debug mode which is what I use to run anyone else's code snippets. Just in case.

And as a sidenote,just got figured out how to get 42 :)


nawi(Posted 2007) [#20]
You should probably think of upgrading your computer if THIS game is too slow


rdodson41(Posted 2007) [#21]
Its just that when I click it can take up to 5 seconds before the number appears, and I have a Mac G5 so I don't think its the computer.


Kyler(Posted 2007) [#22]
Cool game. I got 40 on my 1st try.


Reactor(Posted 2007) [#23]
"You should probably think of upgrading your computer if THIS game is too slow"

LOL

29 on my second go... I'll have to keep working on it :)

EDIT: Okay I'm happy- 42 on my third.


Curtastic(Posted 2007) [#24]
Hi, nice game! I just wrote a program to solve it.
I left it on for 20 minutes and it only got 41, but it checks every possible sequence so eventually it will solve it, if its possible.




nawi(Posted 2007) [#25]
Hmm, a brute-force method might take a too long time.


anawiki(Posted 2007) [#26]
Game is slow because Grey forced it to 2 FPS :D
Remove last 2 from graphics command and it will run just fine.


rdodson41(Posted 2007) [#27]
haha didn't notice it, that would explain it