Ad
  • Default User Avatar
  • Default User Avatar

    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.

  • Default User Avatar

    Merge conflict due to:

    recent changes from related record must be merged first.

  • Default User Avatar

    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

  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar
  • Default User Avatar
    • Fixed the context issue.
    • Added assertion messages to random tests (which are now as useful as the fixed tests)
    • Made it 100 random tests

    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.

  • Default User Avatar

    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)

  • Default User Avatar
  • Default User Avatar

    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!

  • Default User Avatar

    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

  • Default User Avatar

    @196alex, you've crossed an over zealous English teacher, so you've found yourself on the business end of a pedant bomb. Hunker down...

    English/Americans are gonna be here going "why is y a vowel"

    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!

  • Default User Avatar

    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...

    Are we speaking english here? What do you mean how do I know it's sometimes a vowel and mostly a consonant? I'm english back to the damn romans invading britain, I barely speak a second language because I decided to learn german as a hobby. I might not be an english student, but I'm reasonably familiar with english as a language and the usage of letters. For example, in countdown: https://www.youtube.com/watch?v=qOYv1qicEcc - Ignoring the 7 million to 1 odds of her spelling her name, note the Y comes from the consonants?

    Counts from your quote:

    Y as vowel = 3

    Y as consonant (semi-vowel) = 1

    Y as letter = 1

  • Loading more items...