6 kyu

Fruit Machine

151 of 3,322adrian.eyre
Description
Loading description...
Arrays
Games
Fundamentals
  • Please sign in or sign up to leave a comment.
  • Cloud Walker Avatar
    2. Each reel has 10 different items.
    
    3. The three reel inputs may be different.
    

    How can the 3 reels be different when each reel must contain 10 different items and there are only 10 different items to choose from in scoring? Does he mean arranged differently? Or maybe items not included in scoring can be included in the reels? If that's the case it should be stated clearly.

  • saudiGuy Avatar

    python new test framework is required. updated in this fork

  • ejini战神 Avatar

    C#: method name should be PascalCase (Please refer to implementation of backward compatibility here )

  • R.Daneel.Olivaw Avatar

    Amazing Kata, Thanks!!!

  • Lukasz-334 Avatar

    However, the tests pass no trial, is it possible?

  • Galmer Avatar

    In random tests, an error sometimes appears. I ran the same code 10 times and in 3 cases it appeared, and in the rest the tests were passed!

    Reel 1 = Wild Star Bar Bell Seven Cherry King Shell Queen Jack Reel 2 = Wild Bar Queen Bell Shell Seven Jack Star King Cherry Reel 3 = King Queen Seven Star Shell Cherry Bar Bell Jack Wild spins = 0 0 5 Expecting - 10 Test Failed Expected: 10 But was: 20 Completed in 38.3670ms RandomTests() Log Reel 1 = Shell Star Bar Seven Cherry Jack Wild Queen King Bell Reel 2 = King Bar Jack Bell Seven Shell Wild Queen Cherry Star Reel 3 = Bell Bar Cherry Wild Shell Queen Seven Star Jack King spins = 2 6 3 Expecting - 10 Test Failed Expected: 10 But was: 20

    In my case, this is due to the fact that I multiply by 2 the result if there are 2 identical pictures and there is a "Wild" picture, regardless of the types of matching pictures. The error should appear on every check, but random tests do not take this into account!

  • Husoski Avatar

    The Ruby translation would be nicer if there were sample tests added. It's possible to debug from the Attempt output, but not very much fun.

  • tedzbear Avatar

    The "scoring" is blacked out.

  • dummyaccount Avatar

    This comment has been hidden.

  • Enkhtugs Avatar

    Oh man, I was barely passed random test cases and It was really fun to solve. I came here after solving your Mexico Wave kata and this one is really liked :)

  • natan Avatar

    @adrian.eyre since you're active I'll leave this as a suggestion rather than editing directly there's no python translation to fork python 3.8/new test framework posting replacement code below (separately to avoid spoilering this message)

  • sleepysnapdragon Avatar

    Can't wait to hit submit and see how someone much smarter than me has solved this in 1 line compared to my reams of code...

  • sarwin Avatar

    This is a good and fun Kata but can you provide a dictionary or lookup for equivalent values for each spin? Or do we really have to write it out ourselves?

  • mcmlevi Avatar

    fun to work on but damm did It feel like I had to do alot of data management to make the input usable.

  • KevinFox24 Avatar

    I use python and I have a problem. There are 1-4 'Failed' in the 'Random tests', it says like "Should return: '10': 20 should equal 10", but my return equals 'Expecting result'. Why is it failed?

  • clcraig Avatar

    @adrian.eyre, C/C++ & Java translations available. Be sure to approve the Java version last. It has all changes to the description, so that should avoid merge conflicts.

  • Firefly2002 Avatar

    Fun kata. Maybe provide the object/hash/dict of card values though so people don't have to write it out themselves?

  • jhughessuta Avatar

    I passed all the sample tests, but am failing the third 'attempt' test (ruby).

    It says: Should return: '10' - Expected: 10, instead got: 0

    I can only guess from that that it's failing when there are two wilds and something else, but when I test that on my own it works. Any help figuring out what that is testing for?

  • pieterst Avatar

    Maybe add to the instructions that spins are never more than 9, I initially added some unnecessary code to account for spins that were 10 or more.

  • ScareIT Avatar

    This comment has been hidden.

  • RobertRappole Avatar

    This comment has been hidden.

  • GiacomoSorbi Avatar

    Crystal translations for you, cheers :)

  • Kaiyou Avatar

    (C#) If you make it mandatory to work with a List, at least put the using directive System.Collections.Generic in there,....

  • Boumbap Avatar

    I have an error with the random in Python and I don't know why. I tried the random input with PyCharm and it work fine (the code return the proper solution).

  • Blind4Basics Avatar

    Another very nice and neat one! Congrats!

    :)

  • Testerinhio Avatar

    Why do you use "Test.expect" instead of "Test.assertEquals". It is really annoying to use console.log to get the result, that the own method returns...