Skip to content

Commit

Permalink
Updated some variables and experimented with looping
Browse files Browse the repository at this point in the history
  • Loading branch information
rgvh committed Jul 10, 2019
1 parent 5c2f0f0 commit 201bc36
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 55 deletions.
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"python.pythonPath": "/Users/richardvonhagel/.local/share/virtualenvs/game-of-greed-Tdzlo7lJ/bin/python",
"python.linting.pylintEnabled": false,
"python.linting.pep8Enabled": true,
"python.linting.enabled": true
"python.linting.pep8Enabled": false,
"python.linting.enabled": true,
"python.linting.flake8Enabled": true
}
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ verify_ssl = true
[dev-packages]
pep8 = "*"
autopep8 = "*"
flake8 = "*"

[packages]
pylint = "*"

[requires]
python_version = "3.7"
43 changes: 0 additions & 43 deletions Pipfile.lock

This file was deleted.

29 changes: 19 additions & 10 deletions game_of_greed.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,39 @@
score
'''
current_round = 1
round_score = 0
total_score = 0

play = input("Would you like to play?")
if play == 'y':

if play == 'n':
print("Sorry, you're missing out")

set_aside = 0
roll = []
print(f'Starting round {current_round}')
set_aside = 0
roll = []


# def roll_dice(p)
for i in range(set_aside, 6):
selected = random.randint(1, 6)
roll.append(selected)
print(f'Your rolled: {roll}')
for i in range(set_aside, 6):
selected = random.randint(1, 6)
roll.append(selected)
print(f'Your rolled: {roll}')
current_round += 1

print("Which results do you wish to keep?")
new_aside = input()
set_aside = int(set_aside) + len(new_aside)
print(f'You have currently are holding {set_aside} die aside')

round_score = 0
print("What was you score?")
add_score = input()
score = int(score) + int(add_score)
print(f'Your current score is {score}')
round_score = int(round_score) + int(add_score)
total_score = int(total_score) + int(round_score)
print(f'Your current score is {total_score}')

print("Do you want to 'bank' or 'roll' again?")


print(f'Game Over. Your total score was: {total_score}')
1 change: 1 addition & 0 deletions test_game_of_greed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from game_of_greed import

0 comments on commit 201bc36

Please sign in to comment.