6 kyu
Prime ant
297 of 372kodejuice
Loading description...
Mathematics
Logic
Arrays
Games
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
In Python tests use
is
operator incorrectly generating these warnings:Fork (includes framework update)
Thanks, approved
Nice one, well done.
What kind of voodoo magic is this kata?
ok, we need to return the position, not the value.
maybe
p = p+1
is better than arrow<-
.Way better description is here : https://www.codewars.com/kata/prime-ant-performance-version/ The output - it has to be the index of an ant current position.
True, and thanks for posting this message that allowed me to understand quickly the actual task. Description should be improved.
Ruby translation
Please review and approve.
I think that tests doesn't work properly now. Take a look pls.
Can you be more specific or do you want me to guess?
Give examples of actual input & output, and what the correct output should be.
Examples: n = 2531 Expected: 2003, instead got: 171
n = 832 Expected: 516, instead got: 74
n = 1131 Expected: 759, instead got: 93
n = 5023 Expected: 4273, instead got: 293
and so on...
Fixed. Refresh and retry
Everything works fine now. Thanks.
I created a performance version of the kata, you may put a link to it in the description:
https://www.codewars.com/kata/prime-ant-performance-version/
Cheers
looking nice, Done ;)
Thanks.
How about my other suggestion below?
yh done
I suggest you use a standard division sign (
/
) in the description, because÷
and+
look very similar.And example test cases could be sorted in increasing order, that would make a bit more sense.
Fixed description.
This comment has been hidden.
This comment has been hidden.
Actually thats not where i got the problem from, but i have added external sources including this.
Alright, approved ;-)
Nice one! :)
Some suggestions to improve a bit the description:
p ← p + 1
A[p]
, so that it will be easier to track the different requirements.arrows => ?!? :o
The ant moves from p to p+1, right? So why are they in the "good" direction? Some mathematic notation I should know about?
Notation doesn't make sense unless you explain what they mean ;-)
(I suggest you reading the real pre-historic programming languages, their syntax are all over the place ;-))
"affect the value
p+1
in the cell holdingp
", right?