Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
Uhm, I'm not sure if it's the right word to use "step" because it seems you are still confusing the "step" with the "resulting location on the board" - remember, your guess isn't "Was your x_th step =
something
" but rather "Is the piece currently at(location)
".But yes the above walk through example seems to be on the right track if that's what you mean - you are trying to systematically rule out which move patterns may or may not have been used.
And as you correctly identified previously, if you do this naively (combinatorially) you will need a very large number of guesses >>> 500, so you need to be smarter.
Also, as your above example shows, it may actually be the case that you decide to guess each "step" (again - better to use the word location) more than once. For example, your own example leads to you guessing the location
(10,10)
more than once as part of your strategy.Hi @suuujuuus - first of all, thank you for your interest in this Beta kata.
Most of what you said is correct - except for part b) : I think where you're confused (or maybe my description isn't clear enough) is that you don't have to deduce the full "move pattern" that the genius is using -- all you have to guess/find is one location at the right time/step.
So you're not trying to guess e.g. that the genius is performing the move pattern
[ (+1,-1), (+3,-99), (-5,-60) ]
repeatedly - you are trying to "catch" the piece at one single correct location.That's why your solution list (of length 500) is therefore 500 2-tuples; each one is a location on the board, not a move pattern.
Hence, to be clear, when you say:
But how do I figure out if a single guess is correct, so I can build on that?
you don't need to worry, as the kata will compare your solution list to the actual trajectory of each game, and as long as one single location guess is correct, you will win.
You are guessing the current location of the piece after each time it was moved, not the moveset that was used.
And the move of the piece will follow the unknow moveset.
"-" <* s
( or, equivalently,
s *> "-"
)join (***) length
==(***) length length
length *** length
==\ (xs,ys) -> (length xs,length ys)
join
functions as the W-combinator,W f x = f x x
( it's used here in the(->) r
Monad ( Reader? ), which I think of as the Function Monad ). I don't even know how(***)
works exactly; it's also used in some specific Arrow I guess ( well, of course it is ). It just works is all I know.I'll readily admit it adds very little but confusion. But it means I don't have to have
length
twice ( at the cost of just another function, which I have to import to boot. I said it doesn't add much ); it defines thatlength
is applied to both tuple elements.numLength
has to be exact. There is no number with length 76 in the series.Fixed.
This is the real problem. It's not with your code.
There is something wrong with testing.
You can't delete your solution, but it'll be invalid once the tests get fixed.