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

Diet and perseverance #84

Open
Andremora004 opened this issue Nov 30, 2021 · 3 comments
Open

Diet and perseverance #84

Andremora004 opened this issue Nov 30, 2021 · 3 comments

Comments

@Andremora004
Copy link

ENGLISH (google translate)
The story I produced is nothing more than an account of an imaginary man who went on a diet for a year after reaching 150kg. Obviously I am not a dietician, so I do not recommend everyone to imitate what is written in the story, as it is all made up. The aim of the story was not to propose a lifestyle, but to make people realize that with perseverance and determination you can do anything.
As soon as the program has started, an output appears on the screen to introduce everything.
After these we go inside a "for" loop where the counter variable "i" which was initially 0, which represents the days of the year, increases each time the loop is executed.
If "i =" 1 "then a speech for the first day of the year will appear on the screen. (In the case of the first day of the year, Easter, Halloween, Birthday, Christmas and New Year the speeches are fixed)
If "i" is not the same as the above cases then the situation is different: in fact if "i" represents a Saturday or a Sunday then "i" + day will appear on the screen (so as to indicate what day of the year it is), and subsequently the execution of the main program is interrupted and the "weekend" subroutine is passed.
From the "weekend" subroutine, you immediately pass to another "festive_casual" subroutine which, through the srand () function, inserted inside a "while" loop, which prevents two identical days in a row, generates a random number between 1 and 6 which will be returned to the weekend subroutine, and depending on the number issued, a speech will correspond.
If "i" is not even a weekend day then it proceeds in a practically identical way as for the weekend but with different phrases.
The "for" cycle I was talking about at the beginning will repeat itself for 365 days and then stop.

Andrea Moramarco 11/30/21

You can see the code here: https://github.com/Andremora004/Progetti.git

@hugovk
Copy link
Member

hugovk commented Nov 30, 2021

Good work!

https://github.com/Andremora004/Progetti/blob/main/Diet%20and%20Perseverance.txt is 45690 words, can you extend it to 50000 words or more?

@Andremora004
Copy link
Author

OKOK
I forgot that from Italian to English there are much fewer words ...
anyway i did it now it should work!

@hugovk
Copy link
Member

hugovk commented Nov 30, 2021

Excellent!

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

No branches or pull requests

2 participants