Ad
  • Custom User Avatar

    done

  • Custom User Avatar

    My rust translation shows both. You get the u8 bytes and the same data decoded as a Latin1 string.

  • Custom User Avatar

    (I meant to mark this suggestion as resolved, hereby).

  • Custom User Avatar

    I've now published my translation, see the new suggestion I made.

  • Custom User Avatar

    I've created a new translation; the tests in the translation were partially based on yours but I extended them (adding the advanced and random tests, as well as several corrections made to the general kata test suites). I also re-used your starting template.

    My translation features an optimising BF interpreter that matches and exceeds the optimisations made in the other kata translations here.

  • Custom User Avatar

    I might pick this up at some point. I already started on a Rust version, your version could be helpful in accellerating the process.

  • Custom User Avatar

    I've fixed this across all translations, by escaping the quote:

    end
    msg " That\'s end"
    
  • Custom User Avatar

    Got the answer, kept for posterity to clarify the rule on defender bonus calculation:
    "M attack. R Power 4. R wins
    Go to the trench
    P has power 3 of the L team. It gets the trench defense bonus 6 so it wins. 2 remains after the successful defense.
    2 points is less than the original 3 so it keeps 2 power
    It overpowers first s and losses 1 power point keeping 1.
    Overcomes the second s with a draw and retreats. The next s wins its position"

  • Custom User Avatar

    Can someone explain why with this input:

    m     
    -|pzzz
    

    the expected output is R|LLLR (not R|LLLL)?

  • Custom User Avatar

    Haskell fork that updates the random test generation to avoid generating numbers with exponents.

  • Custom User Avatar

    Sorry for offtop, but what software you used to generate this image? I was looking for something like that for a while

  • Custom User Avatar

    My solution is just an optimized version of permutating active tasks and calculating minimum time needed, so it's supposed to work.

  • Custom User Avatar

    How does your algorithm fare on this test case?

    1. Wash: carrots for 10 minutes
    2. Wash: rice for 5 minutes
    3. Boil: rice (takes 10 minutes)
    4. Boil: carrots (takes 2 minutes)
    5. Add: carrots for 20 minutes
    
  • Custom User Avatar

    The current reference solution returns suboptimal answers in some cases, for example:

    1. Wash: meat (takes 2 minutes)
    2. Wash: eggs (takes 1 minutes)
    3. Peel: eggs (takes 6 minutes)
    4. Cut: cheese (takes 2 minutes)
    5. Fry: cheese for 13 minutes
    6. Grate: cheese (takes 2 minutes)
    7. Fry: cheese for 30 minutes
    8. Wash: eggs (takes 3 minutes)
    9. Wash: eggs (takes 2 minutes)
    

    As shown in the Gantt chart below, the optimal answer is no more than (4) + (5) + (6) + (7) = 47 minutes, while the reference solution returns 48.

  • Custom User Avatar

    I would add test cases as this too. Not sure ref sol deals with those correctly. Such cases skip scheduled active tasks to give priority to future active tasks on other ingredient first, after an ongoing passive one.

    1. Wash: carrots for 10 minutes
    2. Wash: rice for 5 minutes
    3. Boil: rice (takes 10 minutes)
    4. Boil: carrots (takes 2 minutes)
    5. Add: carrots for 20 minutes
    
    -> should take 32 minutes
    - start 1 and 2
    - when 2 completes, don't start 3 yet
    - when 1 completes, start 4
    - when 4 completes, start 3 and 5
    
  • Loading more items...