NaNoGenMo / 2021

National Novel Generation Month, 2021 edition.
45 stars 8 forks source link

Diet and perseverance #84

Open Andremora004 opened 2 years ago

Andremora004 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

hugovk commented 2 years ago

Excellent!