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

Refactor main #4

Open
AndersonAlencar opened this issue Apr 2, 2020 · 0 comments
Open

Refactor main #4

AndersonAlencar opened this issue Apr 2, 2020 · 0 comments

Comments

@AndersonAlencar
Copy link

Arquivo:
main

Função:
Farmacia()
Comprar()

Sugestão de melhoria:
Ao invés de fazer if lets aninhados, voces poderiam utilizar eles na mesma linha, deixaria o código mai limpo e fácil de tratar. Ex:
if let input = readLine(), let aux = Int(input){
teste.tamagotchi.medicar(aux)
teste.tamagotchi.estado()
status()
}else{
if input == "cp"{
comprar()
}else if input == "v"{
menuP()
}
}
}

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

No branches or pull requests

1 participant