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.
Quite the optimist :D
Your changes look good, but since it's a fork of my translation, I can't approve it. However, if you made your own, separate translation, I would be able to.
Merge conflict due to:
Unfortunately the Julia unit test is very unexpressive and only prints a message on a failure. However, I've changed how the test names are shown (now they are
findmincost(money, days, cost) --> expected
). The only other option I can think of would be to assign them to variables which look like the test names you suggest (e.g.Cheapest_day_rental = findmincost(money, days, cost)
->Cheapest_day_rental --> expected
. Also, I've added the length of the cost array to the extra large random tests. Let me know what if you have any other thoughts. Cheers!Edit: While the changes I made show up here, they don't appear on the kata or in the run output. Not sure why
This is just another way to define a function, so there should be no perfomance difference. It's mentioned in the docs as "assignment form". It's often preferable when it can be used while remaining readable like in this example. I like to do this for fun, however, if you see some of my more contrived "assignment form" solutions on codewars, in practice, they often could be better as full function definitions to improve readability, by expanding out, and/or performance, by using more efficient algorithms/memory management/etc which the compactification didn't allow for.
For any other future reviewers:
I've fixed the issues raised below, with the exception of adding type annotations to the function because there was no valid reason given by the previous reviewer. From what I can find, type declarations are not added arbitrarily to functions in Julia:
If I've missed something, either about this being a codewars platform issue or if it is indeed idomatic to include type declarations, please let me know and I'll change that part of the code. Otherwise I'll leave it as idomatic as I know how to.
I've gone ahead and made it
"Failed for: $(repr(word))"
, which I presume you meant. This now prints with quotes around the input.Could you clarify why you would like to annotate the function types? From everything I've seen, it is not idomatic in Julia to do that for every function. Usually it's only done when there is multiple dispatch or performance concerns, and I don't see either of those in this kata.
Why include types in a 7 kyu?
Fixed the
facts
\context
issue.context
issue.The assertion messages only show on failure, so I've included the input provided for the random tests so users can see the input explicitly on failure. This information was already present in the fixed tests due to how they are reported. Let me know if there is something else more useful.
Since calls to FactCheck are so slow, I usually try to avoid going over 100 tests (hence the initial 55 random tests). With the full 100 the full test suite is now running at 7000-8000ms (up from ~5000ms). However, I could change it so not every random test involves a call to
@fact
and quits on the first failure. Not sure which is preferable.Julia sample tests use different function names (
uint2quint
,quint2uint
) than those given in the solution setup and used in the full test suite (toproquint
,fromproquint
)Fix
You may well have found good evidence backing your claim, but I categorically refuse to look at anything that could potentially start to undermine my irrational beliefs. Instead, I will retreat further into my shell by only recognizing Y as either a vowel or semi-vowel. The concept of Y as a consonant be banished!
Call me obstinate, call me an ideologue, call me an obstinate ideologue, or call me a twat. You probably wouldn't be too far off with any of these characterizations, but one thing is for sure, you Y-Consonanters have had your day!
Valiant you may be, but I'm afaid your cause is lost as I have destiny on my side seeing as it can be no coincidence that VICTORYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY!!! is spelled with a vowel Y
@196alex, you've crossed an over zealous English teacher, so you've found yourself on the business end of a pedant bomb. Hunker down...
I'm not sure you should lump Americans into this group... I've never had any qualms thinking of Y as a vowel, and actually have a harder time seeing it as a consonant. Probably because, even using the structural definition (i.e where the Y falls in a word), most occurences in English are categorized as vowels (I'm unaware of a definition which extends beyond mere assertion that has most English occurences of Y being categorized as a consonant).
However, let's be honest, nobody cares about that dross... It's come down to a battle of whose schoolhouse rote will win the day. So, don't give up, and fight to the death we shall! Arbitrary definitions must be defended!
While your English credentials and provided reference are surely impeccable, what classifies Y alternately as a vowel and a consonant here is likely not a matter of English or game shows, rather a matter of phonology (i.e. how the sound is produced in your mouth). Basically, consonants show significant restriction of airflow by the tongue while vowels allow for free flowing airflow. In this light, classifying Y as a consonant could be seen as a bit dubious, since it generally is either a vowel or a semi-vowel.
Small sample, but just for fun...
Counts from your quote:
Y as vowel = 3
Y as consonant (semi-vowel) = 1
Y as letter = 1
Loading more items...