2021 icon indicating copy to clipboard operation
2021 copied to clipboard

Diet and perseverance

Open Andremora004 opened this issue 4 years ago • 3 comments

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

Andremora004 avatar Nov 30 '21 19:11 Andremora004

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?

hugovk avatar Nov 30 '21 20:11 hugovk

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

Andremora004 avatar Nov 30 '21 21:11 Andremora004

Excellent!

hugovk avatar Nov 30 '21 21:11 hugovk