Comments (3)
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.
@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.
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)
- How to submit homeworks/problem sets HOT 2
- Rust (1987) Python code
- Machine Learning material HOT 2
- Sublime Text [or other editor] button in Mac Finder HOT 1
- LaTeX symbols HOT 1
- Errors in running install_SG.sh HOT 5
- Jupyter notebooks on the cluster. HOT 1
- Try grid1.setSurplusRefinement(fTol, -1, "fds")
- Plotting points and function HOT 2
- Fixing the error when running main.py HOT 1
- Midway Alias (an easier way to access Midway, for Mac)
- Draw random numbers in C++ HOT 2
- Does anyone know how to time functions in C on cluster?
- Dynare Pset
- Cannot run Dynare in MatLab HOT 1
- Intertemporal Asset Pricing using scipy.optimize.broyden1 HOT 2
- Bellman equation in Aiyagari problem set HOT 1
- Trouble reading Pickle file & the wayout
- Linear Systems - Sparse matrices HOT 4
- Gauss-Seidel HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootcamp2019.