Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Risk-risiko #152

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rubinoWhoDev
Copy link

Implementate funzioni per stampare a schermo i dadi dei giocatori e per stampare i vincitori

Copy link
Collaborator

@makapx makapx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correggi gli errori della pipeline. Per il resto mi fido, anche perchè non gioco a risiko da una vita 👀

@rubinoWhoDev
Copy link
Author

Non capisco che errori mi stia dando la pipeline, controllando nei check di github vedo solo che genera un'eccezione e dice che tutti i controlli falliscono ma senza darmi nessun motivo del perché

print(dices[1], "(M)")
print(dices[2], "(0)")

def printResults(red, blue):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Un po' di type hinting fa ssempre bene:

def randDice() -> int:
#....
def printDices(dices: list[int]):
#...

@TendTo
Copy link
Collaborator

TendTo commented Oct 30, 2023

Non capisco che errori mi stia dando la pipeline, controllando nei check di github vedo solo che genera un'eccezione e dice che tutti i controlli falliscono ma senza darmi nessun motivo del perché

Il problema e' questo:

src/risk-risiko.py:30:0: C0305: Trailing newlines (trailing-newlines)

sembra ci sia un accapo di troppo alla riga 30

@@ -0,0 +1,29 @@
import random

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Importa solo la funzione randint dal modulo random.

import random

def randDice() -> int:
return random.randint(1, 6)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definisci sempre i valori costanti in opportune variabili.

MIN_NUMBER=1
MAX_NUMBER= 6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants