Discuss Scratch

WooHooBoy
Scratcher
1000+ posts

"Hive" Strategy?

DigiTechs wrote:

By the looks of things, Hive is based on ‘Lights Out’ - https://en.wikipedia.org/wiki/Lights_Out_(game)

EDIT: That wikipedia page also has some information for solving ‘Lights Out’ using an algorithm, so if you base your algorithm on that you'll probably find a nice way to solve it.

Also, a nice way to make it harder is to increase the grid size

EDIT 2: Oh look here! I found a solution! http://math.stackexchange.com/questions/11091/lights-out-game-on-hexagonal-grid
I didn't understand any of that answer, so I suppose I can figure it out myself!

DigiTechs
Scratcher
500+ posts

"Hive" Strategy?

WooHooBoy wrote:

DigiTechs wrote:

By the looks of things, Hive is based on ‘Lights Out’ - https://en.wikipedia.org/wiki/Lights_Out_(game)

EDIT: That wikipedia page also has some information for solving ‘Lights Out’ using an algorithm, so if you base your algorithm on that you'll probably find a nice way to solve it.

Also, a nice way to make it harder is to increase the grid size

EDIT 2: Oh look here! I found a solution! http://math.stackexchange.com/questions/11091/lights-out-game-on-hexagonal-grid
I didn't understand any of that answer, so I suppose I can figure it out myself!


Haha. It's still pretty awesome, though
MegaApuTurkUltra
Scratcher
1000+ posts

"Hive" Strategy?

WooHooBoy wrote:

MegaApuTurkUltra wrote:

ChocolatePi wrote:

This game is like a nightmare
Lol

WooHooBoy wrote:

19 choose 8 = 75582

If someone made a JS implementation, this could be brute forced easily
But I think you're allowed to click in the same place multiple times right? So wouldn't it be 19P8?
Doing this is pointless, though.

In another note any moves you make can be done in any order and give the same result.
Ah that's a good point. So you have to find moves that hit each block the same (odd) number of times.
WooHooBoy
Scratcher
1000+ posts

"Hive" Strategy?

MegaApuTurkUltra wrote:

WooHooBoy wrote:

MegaApuTurkUltra wrote:

ChocolatePi wrote:

This game is like a nightmare
Lol

WooHooBoy wrote:

19 choose 8 = 75582

If someone made a JS implementation, this could be brute forced easily
But I think you're allowed to click in the same place multiple times right? So wouldn't it be 19P8?
Doing this is pointless, though.

In another note any moves you make can be done in any order and give the same result.
Ah that's a good point. So you have to find moves that hit each block the same (odd) number of times.
I guess the next question is to find out how many 8-flip combinations there are?

Then try to find a method of coming up with optimal solves on bigger grids.
Thepuzzlegame
Scratcher
1000+ posts

"Hive" Strategy?

PullJosh wrote:

Thepuzzlegame wrote:

Took me 20 moves on my first try
Hmm, so an algorithm which solves this in the least number of moves possible…that should be possible.
I've tried at least 10-20 times, and only completed it once.

It took 80 moves.
I think I got lucky or something, cause it took me a long time to solve it again.
TheMonsterOfTheDeep
Scratcher
1000+ posts

"Hive" Strategy?

My first winning run was 14 tries. I really like the game Lights Out and played a similar game by Bart Bonte.

I would definitely rather brute force this than math it out.
PullJosh
Scratcher
1000+ posts

"Hive" Strategy?

So, I know I said I wasn't going to brute force it, but… Y'know. :3

Eight, as long as my program is correct, is the best possible score. However, there are a couple of ways to get eight. I've numbed each tile, as shown below:



Each line shows one solution, listing the tiles which need to be clicked:
1, 2, 5,  8,  11, 14, 17, 18
1, 3, 4, 5, 11, 12, 14, 16
1, 3, 6, 7, 8, 9, 13, 15
2, 3, 6, 9, 12, 15, 18, 19
4, 6, 8, 9, 15, 16, 17, 19
5, 7, 11, 12, 13, 14, 17, 19

The code I used is available here, and it would be great if somebody could check it to make sure it's accurate. I don't want to miss any!
Dylan5797
Scratcher
1000+ posts

"Hive" Strategy?

PullJosh wrote:

So, I know I said I wasn't going to brute force it, but… Y'know. :3

Eight, as long as my program is correct, is the best possible score. However, there are a couple of ways to get eight. I've numbed each tile, as shown below:



Each line shows one solution, listing the tiles which need to be clicked:
1, 2, 5,  8,  11, 14, 17, 18
1, 3, 4, 5, 11, 12, 14, 16
1, 3, 6, 7, 8, 9, 13, 15
2, 3, 6, 9, 12, 15, 18, 19
4, 6, 8, 9, 15, 16, 17, 19
5, 7, 11, 12, 13, 14, 17, 19

The code I used is available here, and it would be great if somebody could check it to make sure it's accurate. I don't want to miss any!
Nice.
-Io-
Scratcher
1000+ posts

"Hive" Strategy?

PullJosh wrote:

So, I know I said I wasn't going to brute force it, but… Y'know. :3

Eight, as long as my program is correct, is the best possible score. However, there are a couple of ways to get eight. I've numbed each tile, as shown below:



Each line shows one solution, listing the tiles which need to be clicked:
1, 2, 5,  8,  11, 14, 17, 18
1, 3, 4, 5, 11, 12, 14, 16
1, 3, 6, 7, 8, 9, 13, 15
2, 3, 6, 9, 12, 15, 18, 19
4, 6, 8, 9, 15, 16, 17, 19
5, 7, 11, 12, 13, 14, 17, 19

The code I used is available here, and it would be great if somebody could check it to make sure it's accurate. I don't want to miss any!
They're all your original 8 move solution rotated e.e
BookOwl
Scratcher
1000+ posts

"Hive" Strategy?

-Io- wrote:

PullJosh wrote:

So, I know I said I wasn't going to brute force it, but… Y'know. :3

Eight, as long as my program is correct, is the best possible score. However, there are a couple of ways to get eight. I've numbed each tile, as shown below:



Each line shows one solution, listing the tiles which need to be clicked:
1, 2, 5,  8,  11, 14, 17, 18
1, 3, 4, 5, 11, 12, 14, 16
1, 3, 6, 7, 8, 9, 13, 15
2, 3, 6, 9, 12, 15, 18, 19
4, 6, 8, 9, 15, 16, 17, 19
5, 7, 11, 12, 13, 14, 17, 19

The code I used is available here, and it would be great if somebody could check it to make sure it's accurate. I don't want to miss any!
They're all your original 8 move solution rotated e.e
It seems that the order that you make your moves doesn't matter.

Also, I've ported Hive to python. You can find it on Github.

Last edited by BookOwl (Jan. 21, 2016 19:20:34)

PullJosh
Scratcher
1000+ posts

"Hive" Strategy?

BookOwl wrote:

It seems that the order that you make your moves doesn't matter.
Of course not! Although I suppose I don't have a great way of explaining why. Just think about it for a little while and it should make some intuitive sense.

-Io- wrote:

They're all your original 8 move solution rotated e.e
Interesting… I hadn't noticed! So as long as my code is correct, that means there is only one unique 8-click solution.
IronBit_Studios
Scratcher
1000+ posts

"Hive" Strategy?

It's impossible to get under 8, if I did my math right.
wizzwizz7
Scratcher
500+ posts

"Hive" Strategy?

Ha! If I remember right, the fewest you need to do is 6. I wonder if we could make a) a computer program that solves stuff like that in the minimum moves, ideally on Scratch b) a mathematical proof as to why the minimum is six. DigiTechs is right, though; I'm going to look on there and perhaps replicate the algorithm in Scratch.
Zro716
Scratcher
1000+ posts

"Hive" Strategy?

For the record, I find it funner to make interesting patterns than to finish the game.
PullJosh
Scratcher
1000+ posts

"Hive" Strategy?

Zro716 wrote:

For the record, I find it funner to make interesting patterns than to finish the game.
I find it more fun to correct grammar than to actually contribute to the discussion.
PullJosh
Scratcher
1000+ posts

"Hive" Strategy?

wizzwizz7 wrote:

Ha! If I remember right, the fewest you need to do is 6. I wonder if we could make a) a computer program that solves stuff like that in the minimum moves, ideally on Scratch b) a mathematical proof as to why the minimum is six. DigiTechs is right, though; I'm going to look on there and perhaps replicate the algorithm in Scratch.
Hmm… My code gave no solutions better than 8. I hope I didn't do anything wrong!

(Glad you're into the maths as well, that's the bit that I'm really interested in.)
wizzwizz7
Scratcher
500+ posts

"Hive" Strategy?

PullJosh wrote:

Zro716 wrote:

For the record, I find it funner to make interesting patterns than to finish the game.
I find it more fun to correct grammar than to actually contribute to the discussion.
ooh rekt
wizzwizz7
Scratcher
500+ posts

"Hive" Strategy?

PullJosh wrote:

wizzwizz7 wrote:

Ha! If I remember right, the fewest you need to do is 6. I wonder if we could make a) a computer program that solves stuff like that in the minimum moves, ideally on Scratch b) a mathematical proof as to why the minimum is six. DigiTechs is right, though; I'm going to look on there and perhaps replicate the algorithm in Scratch.
Hmm… My code gave no solutions better than 8. I hope I didn't do anything wrong!

(Glad you're into the maths as well, that's the bit that I'm really interested in.)
Hmm… I can't remember how I did it. I'll have a go at it some time, but I think somebody demonstrated a similar method earler.
wizzwizz7
Scratcher
500+ posts

"Hive" Strategy?

wizzwizz7 wrote:

PullJosh wrote:

wizzwizz7 wrote:

Ha! If I remember right, the fewest you need to do is 6. I wonder if we could make a) a computer program that solves stuff like that in the minimum moves, ideally on Scratch b) a mathematical proof as to why the minimum is six. DigiTechs is right, though; I'm going to look on there and perhaps replicate the algorithm in Scratch.
Hmm… My code gave no solutions better than 8. I hope I didn't do anything wrong!

(Glad you're into the maths as well, that's the bit that I'm really interested in.)
Hmm… I can't remember how I did it. I'll have a go at it some time, but I think somebody demonstrated a similar method earler.
ARGH!!! I thought I did it in six, but it was eight moves. Sorry for confusion, everyone.
scratchisthebest
Scratcher
1000+ posts

"Hive" Strategy?

Here's a 7-wide9-wide because I'm a dum dum version: https://scratch.mit.edu/projects/95249382

Last edited by scratchisthebest (Jan. 24, 2016 03:38:00)

Powered by DjangoBB