Skip to content

Waypoint: Create a JavaScript Slot Machine #4564

@charles-toller

Description

@charles-toller

The fourth test in this is checking for syntax, and while it is an important check, I believe it can be written a different way that allows for different variations of this syntax while still checking that they are making the calls properly. I'm a relatively new camper, and I can't figure out how to insert it into my fork of the master, but can somebody at least look at this and see if it would work?

assert((function(){var i = 0;Math.random = function(){var randoms = [0.7359089243691415,0.4609197387471795,0.3553516734391451];return randoms[i++];};if(runSlots[0] == 3 && runSlots[1] == 2 && runSlots[2] == 2){return 1;}else{return false;}})(),'You should have used <code>Math.floor(Math.random() * (3 - 1 + 1)) + 1;</code> three times to generate your random numbers.')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions