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.
Thanks for the heads-up! You’re right that under this kata’s rules (ASCII letters only, case-insensitive, empty → false), “xgx” is a palindrome.
I’ve:
Please give it another try with the updated tests. If anything still looks off, ping me and I’ll adjust fast.
thank you for your response! i will work a little bit more on that kata :) i hope you enjoyed it anyway
xgx
is a palindromeapproved
hey, no hard feelings, I also wrote awkward stuff in my own old translations
FOUR
should rather beN
, orCOUNT
, orLENGTH
, something like that. Same thing forONE
, but you can remove it altogether since it's only used forab_min
.rand() % a + b
gives you a range of[b, a + b[
, not[a, b[
, sorry for the confusion. The use of ranges and the signature ofrand_int()
make the logic hard to follow. Seeing a functionrand_int(a, b)
most people will assume it returns an integer in[a, b]
(possibly exclusive ofb
). I think the original intent was thatmn_ranges
andab_ranges
are actuallymn_max
andab_max
, respectively ? It would be clearer to have arand_int(min, max)
function, and pick thosemin/max
values from the arrays.short answer: i wrote this seven years ago
for the record, what you saw here included a ton of alterations & improvements i did maybe about a month ago; it reflects my modern syntax
hope my fixes today make it more clear
I've been thinking about it too
return
something in the initial code ?4
to a named constant (a#define
or anenum
) and mark the arrays as having that length, toorand() % a + b
to arandInt(a, b)
function (Note that currently the endb
is exclusive).reps
named that ? why notn_tests
ortest_counts
?This comment is hidden because it contains spoiler information about the solution
That's not what specifications are. Specifications outline the requirements of the kata directly, explicitly, and upfront, and the expected place for that is the description.
As per the official documentation, in the very first sentence under Writing a Kata Description, it states:
Specified in test cases
For a function that expects an essentially boolean output, it's a better practice to simply return just exactly that instead of a descriptive string value. For that matter, this is not at all specified in the description.
Approved
Approved
This is not a game I have played in real life, although I have played Mutations with someone, usually while on a long drive somewhere.
It is irrelevant that it is established ahead of time whether or not any player knows any or all of the words in the given subject list. They just do the best they can with their memory banks.
A player would not write out all the four-letter words they know before they play a game. First, it's probably way too many to bother with, and you will not even need most of them most of the time. Futhermore, they will not know which ones they will need, because new words will enter the game when their opponent uses a word from their own memory banks.
I hope that helps!
Loading more items...