GithubHelp home page GithubHelp logo

Comments (3)

rebekahanne avatar rebekahanne commented on July 20, 2024 1

I think there are many ways to implement the methods needed to solve this problem. If the isvalid check is only being used for a double roll, then range(2, 13) should be fine. However, as @keertanavc mentions, if the player's sum is less than 6, then only one dice will be rolled. Here, the range(1,7) would be appropriate.

from bootcamp2019.

rickecon avatar rickecon commented on July 20, 2024

@keertanavc. No. This is not a typo or an error in box.py. The line if roll not in range(2, 13): has to do with the fact that you have already rolled a number. @rebekahanne

from bootcamp2019.

keertanavc avatar keertanavc commented on July 20, 2024

The PS mentions that "However, if the sum of the player’s remaining numbers is 6 or less, role only one die." In the situation that my remaining numbers are, say, [1, 2] and I roll a single die and get a 1, isvalid(1, [1,2]) will return a False indicating that the roll is invalid whereas it is actually valid? So shouldn't the code be instead if roll not in range(1, 13): (if we want to squeeze in both the single and double roll cases into one check)? I might be missing something stupid!

from bootcamp2019.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.