[C-prog-lang-l] mountain art competition
Vladimír Kotal
vlada at devnull.cz
Thu Mar 14 20:55:37 CET 2019
In addition to the creative enhancement (reminds me of
https://ajmysmetatry.sk/), the code is nicely structured with a good style.
Some minor nits:
- separate the defines and includes with blank line
- be consistent: rand() % 3 vs. rand()%3
- multiword identifiers can be made more readable somehow (either use
https://en.wikipedia.org/wiki/Camel_case or underscores)
- you are cheating a little bit with those for loops :-) as we have not
introduced them yet
- snow caps drawing can be refactored into its own function - it's extra
feature, maybe later on can be governed by an option
Regards,
V. Kotal
On Thu, Mar 14, 2019 at 12:32 PM Peter G <peter.grajcar131 at gmail.com> wrote:
> Hello,
>
> I have used two functions. One for the printing the mountain and second
> for filling the columns of the array. I also added mountain snow caps,
> which are generated above certain height level.
>
> I put the code on GitHub. It can be found there:
> https://github.com/peter-grajcar/the-c-programming-language/blob/master/src/mountains.c
>
> As an example I attached picture of my mountains.
>
> Regards,
> Peter Grajcar
>
> .
> _______________________________________________
> c-prog-lang-l mailing list
> c-prog-lang-l at mff.cuni.cz
> http://mbox.ms.mff.cuni.cz/listserv/listinfo/c-prog-lang-l
>
-------------- next part --------------
HTML attachment scrubbed and removed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2019-03-14 at 11.46.13.png
Type: image/png
Size: 31344 bytes
Desc: not available
URL: <http://mbox.ms.mff.cuni.cz/listserv/archive/c-prog-lang-l/attachments/20190314/70ee5037/attachment.png>
More information about the c-prog-lang-l
mailing list