Login | Register

RoboZZle Forums

Forums / Puzzles / arbitrary counting

Thread for puzzle arbitrary counting. Hints are OK, but please no full solutions.

 

Log in to comment.

http://www.kevindurant-shoes.us.com
http://www.oakleysunglassesformen.us
http://www.yeezyboost350v2shoes.us.com
http://www.jordan12.us.com
http://www.michael-kors-handbags.com.co
http://www.fentypuma.us.com
http://www.goldengoosesneakers.us
http://www.christian-louboutin.eu.com
http://www.kyrie3.us.com
http://www.kyrie4shoes.us.com
http://www.lebron14.us.com
http://www.chromehearts.com.co
http://www.adidas-tubular.us.com
http://www.nikebasketballshoes.us.com
http://www.yeezyboost-350.uk
http://www.basketball-shoes.us.com
http://www.monclerjacketsoutlets.us.com
http://www.reebokoutlet.us.org
http://www.longchamp-bags.us.org
http://www.adidasiniki.us
http://www.goldengoose-outlet.us.com
http://www.adidas-nmds.us.com
http://www.offwhitexjordan1.com
http://www.tomford-sunglasses.us.com
http://www.nike-hyperdunk.us.com
http://www.toryburchshoes.us
http://www.chromehearts.net.co
http://www.handbagsmichaelkors.com
http://www.adidasnmdshoes.co.uk
http://www.kobesneakers.com
http://www.adidasyeezy.co.uk
http://www.adidaseqts.com
http://www.nikedunks.us.org
http://www.goldengoose.us.com
http://www.yeezyboost350v2.org.uk
http://www.cheapnbajerseys.us.org
http://www.caterpillarboots.us.com
http://www.long-champ.us.com
http://www.hermesbelts.com
http://www.nikeshoesformen.us.com
http://www.goldengoose-sneakers.com
http://www.jordan4.us.com
http://www.oakleysunglassesonlinestore.us.com
http://www.hermes-birkin.us.com
http://www.offwhiteclothing.us.com
http://www.converseoutlet.us.com
http://www.kd-10.us
http://www.raybanonlinestore.us.com
http://www.yeezyboost-350.com.co
http://www.ferragamobelt.us.org
http://www.rbsonlinestore.com
http://www.adidasultraboost.us.org
http://www.curry5.us.com
http://www.nikeflyknitracer.us.com
http://www.oakleysunglassesonline.us.org
http://www.offwhite.us.com
http://www.lebron-soldier11.us.com
http://www.burberryoutlet-store.us.com
http://www.lebron-soldier10.us.com
http://www.michael--korsoutlet.us.org
http://www.russellwestbrookshoes.us.com
http://www.nfljerseysstoreonline.com
http://www.yslhandbags.net
http://www.russellwestbrookshoes.us
http://www.goyardhandbags.us.com
http://www.raybanaviatorsunglasses.org

jing, 15 months ago.

lovely. to turn at the 4th corner you need a cute trick.

babosae's comment after solving the puzzle, 54 months ago.

lovely. you need to use a trick

babosae's comment after solving the puzzle, 54 months ago.

nice.

babosae's comment after solving the puzzle, 54 months ago.

I always try to avoid puzzles with paint. But this is actually quite good. In fact my eyes missed the paint option at first :-) but chadg1980's comment got me back on track.

reinerbaumwoll, 66 months ago.

There is red everywhere! oops.

chadg1980's comment after solving the puzzle, 66 months ago.

Very good explanation sticky. Maybe it should be posted on wiki?

lucjansz, 107 months ago.

I'd hate to toot my own horn, but lcurtne hardly did any explaining.

sticky, 114 months ago.

Thanks icurtne, your explanation has helped me to really understand this kind of stacking, I was just guessing at it before. Great puzzle too, thanks.

Super_Flautist, 114 months ago.

Beginners heaven. Bravo!

arkangelsk1's comment after solving the puzzle, 119 months ago.

Oh, diabolical! My head hurts, but I think I've got it now, although it's going to take some practice. Thanks for the replies everyone, and special thanks to sticky for the puzzle/solution and lucid explanation.

lcurtne, 119 months ago.

Many puzzles of this format follow this sequence: push, pop, turn, repeat.

There's two general ways of doing this, which differ in the number of functions required, and the number of steps that are popped. A good illustration of the difference is in these two puzzles:

http://robozzle.com/puzzle.aspx?id=736
http://robozzle.com/puzzle.aspx?id=909

Since this puzzle only has 2 functions, I could only try the first method, and the extra instructions required were mostly just trying the simplest thing that might work.

keba, 119 months ago.

How easy or hard a puzzle is does not directly translate to how enjoyable it is. For this puzzle you could have made the path a bit longer and in a way that reduced the number of possible solution. For instance in your puzzle you can move then paint or paint then move. The two solutions will look different when solved. If you draw your puzzles carefully you can weed out the unintended solutions. This line of thinking eventually leads to hack blocking and will keep your puzzle as challenging as you intend them to be.

Sticky is very good with stacking puzzles. Listen and learn.

axorion, 119 months ago.

Hey, thanks, sticky. I really appreciate your taking the time to give me such a detailed explanation. I'll try to absorb it all tomorrow and be on my way to a more satisfying Robozzling experience. Thanks again...

lcurtne, 119 months ago.

In the second sentence above, I meant 'single function stacking involving multiple colors...'

sticky, 119 months ago.

Here's an example puzzle and solution that might help.
http://robozzle.com/index.aspx#design/aaaaaaaaaaaaaaaaaaaaayBdaaaaayadaaaaayadaaaaaaadaaaaaaadqlBzBltdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4aQQka,GbmdzQ4Kzitmic

This has conveniently placed red tiles that indicate where turns should be placed on the stack in order to traverse the mini spiral on the right.
This is a multiple function stacking technique (single function stacking involving multiple puzzle tends to be more difficult and less intuitive for learning). So rather than having a stacking function there's a stacking set of functions F2, F3, F4 (the actual action of stacking only occurs in F3 and F4).
I first call F2 which moves forward once, then depending on the color of the resulting movement, calls either F3 if on blue, or F4 if on red. The first tile (colored green) doesn't affect the stack because the stacking functions aren't called while the robot is on this tile.
The robot first lands on a blue tile and calls F3. F3 then calls F2. But there is a forward command after the F2 command. This forward command isn't executed (according to the order of the commands, F2 must be executed first) and is put on the stack to be executed when F2 is finished.
So after landing on the first blue tile, F2 is called again. This means the robot moves forward, then calls either F3 or F4 depending on color. The second time, the robot lands on a red tile and calls F4. F4 then calls F2. This time, we put a left turn and a forward command after the F2 call. This way, we add a left turn to the stack.
F2 is called again and the process repeats. As long as the robot lands on a blue or red tile, it will add either a forward or a left turn to the stack. When it reaches a green tile, F2 doesn't have anything to call, and therefore cannot recursively call itself. Now the stack releases and the left turns and forward commands that we've saved finally execute.

sticky, 119 months ago.

My last sentence sums up that problem.
"These commands are only executed when F2 stops calling itself, then each copy on the stack executes starting with the most recent and ending with the first."
This means that after creating a stack of commands, the order in which the stack is executed begins with the command most recently put on the stack and going backward through the order in which the stack was created. The command that was put on the stack first will be executed last.
In order to solve puzzles in which the commands on the stack vary, you must put the proper commands on the stack in the right order. This will always depend on the shape of the puzzle as it is the puzzle that you use to develop the stack.
A good example is 'Easy Double Spiral' (http://robozzle.com/puzzle.aspx?id=881) which requires you to memorize the shape of a spiral. The second half of the puzzle requires you to traverse the spiral shape in the opposite direction as the first half. The turns are marked in the first half by red tiles. When stacking commands for the second half, you have to stack a forward command for each blue tile, and a left turn command (and a forward) for each red tile.
So when traversing the first half, each time you come across a blue tile, you must recursively call back your stacking function, but leave a forward command that does not execute to be executed when the stack releases. Likewise for red tiles, when you reach a red tile, you must call your stacking function, but leave a left turn behind.

sticky, 119 months ago.

So, did your solution contain a nested recursion? It seems like the problem I'm running up against is sometimes it seems like the 'extraneous' commands need to vary as you're unwinding the stack, and I don't see how to do that...

lcurtne, 119 months ago.

I solved this quickly because it requires only basic knowledge of a simple stacking process, of which I am familiar. I didn't count individual tiles to see if the process would work, I assumed that it was possible to solve using the process I identified as appropriate to the puzzle and I tried it.

Stacking occurs whenever you call a function with some recursive function call inside of it referencing itself, say F2, with some commands following the recursive call of F2. Each time F2 calls itself, it leaves a copy of these extraneous commands on the stack. These commands are only executed when F2 stops calling itself, then each copy on the stack executes starting with the most recent and ending with the first.

sticky, 119 months ago.

Question for those that solved this: Apparently it was pretty easy for you to solve. Was it because you know how to 'count' the stuff on the stack, or was there some reductive solution? I made up this puzzle by creating the solution first, then tailoring the puzzle to fit the solution. I've been struggling with this counting thing for days (Learning Stack, Stack Memory Tutorial, etc.) and I still couldn't solve my own puzzle. It almost seems like there's something about the 'API' that I don't know about or understand, and the 'tutorials' all seem to require solving the puzzle without any narrative or explanation. Poor me. Anyway, I'll keep trying but I sure could use some broad hints. P.S., I'm not unfamiliar with recursive functions, which I frequently use on my job as a .NET developer, but I'm starting to acquire somewhat of a self-image problem. Maybe you could help me out? ...and, thanks, of course...

lcurtne, 119 months ago.

Previous page (1 / 1) Next page

©2009 Igor Ostrovsky and other contributors. Terms of use