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.
OP solved it, closing
A little hint concerning "STRAIGHT":
The numbers in the string must be sorted in ascending order
For example, 34561 => 13456
If there is no 2 in the string, 1 must be the number 7. This is necessary to make an arithmetic progression.
For example, 13456 => 34567 (1 => 7).
If you get an arithmetic progression from the end string, then the string can be designated as STRAIGHT.
If the string has 2 and 1, you just have to check if the numbers in the string make an arithmetic progression
If there is no 1 in the string, you have to do the same thing as 3.
Five consecutive numbers, in any order, 1 could be seen as 1 or 7.
Do not really understand a straight condition. Can someone help me?
Clarified how to use the wildcard.
The 1 as a wildcard is already in the STRAIGHT item description, it's not a wildcard for any other result. And 44441 is a POKER, it's already in the description ;)
I solved this kata according to your comment, but in my opinion
12341
and13451
match theSTRAIGHT
description.It would also be nice to add that the wildcard
1
rule only applies toSTRAIGHT
, because what about the case of44441
? This is notGENERALA
😉Damn that straight condition is straight up fcked up.
Because in 13654 the straight is 34561
No what I'm trying to say is if 13654 is a straight then how can 12346 is not as it is in sequence and just missing a 5 as the earlier one is missing a 2.
No, and that's in the description.
12346 should be equal to 20 rather than 0 in the last test case for js.
While I agree on the part with the description cleanup, your example is wrong, as the wildcards could either be interpreted as 34567 which is not valid since 7 is not on the dice and otherwise 23456, where 3 violates the "only at be beginnig or end" rule.
13451 on the other hand is unclear if it would be accepted.
Ruby 3.0 should be enabled, see this to learn how to do it
Please organize the structure of test fixture as following (although it has been mentioned in the attached link, I'm repeated here again)
Loading more items...