{"id":2338,"date":"2022-02-07T14:23:15","date_gmt":"2022-02-07T14:23:15","guid":{"rendered":"https:\/\/www.codeastar.com\/?p=2338"},"modified":"2022-12-02T18:06:56","modified_gmt":"2022-12-02T18:06:56","slug":"2022-code-a-star-coding-insight-post-covid-19-era","status":"publish","type":"post","link":"https:\/\/www.codeastar.com\/2022-code-a-star-coding-insight-post-covid-19-era\/","title":{"rendered":"My 2022 new coding insight in the Post COVID-19 era"},"content":{"rendered":"\n
Hello guys, our Code A Star website has gone on hiatus for more than a year. And finally, we are back online! Many things were changed last year because of the COVID-19 pandemic. Many people, including me, have felt frustrated on living with the COVID-19 for more than 2 years. But I believe things should go better in the future by analyzing more data and researching more solutions. As long as we keep updating ourselves on facing different situations (updating our own learning epochs), a more accurate output should come out eventually. Similar to most of the machine learning cases, it takes time.<\/p>\n\n\n\n
We call our website as CodeAStar. The original idea is, instead of wishing upon a star, we code a star for making a wish ourselves. But I haven’t thought about how do we code a star before in fact. So, for our first 2022 coding mission, let we code a star! <\/p>\n\n\n\n
Design A Star<\/h3>\n\n\n\n
It likes all of our software projects in past, we go for the Software Development Life Cycle (SDLC) way: define the software requirements first then design our implementation. The things we want are:<\/p>\n\n\n\n
\n
a star graphic generated by code<\/li>\n\n\n\n
configurable <\/li>\n\n\n\n
reusable<\/li>\n\n\n\n
randomized<\/li>\n\n\n\n
plain and easy!<\/strong> <\/li>\n<\/ul>\n\n\n\n
In order to create a star graphic using coding, first we will need a programming library that can create graphics. Second, we will code several geometries to form a star, so it means we will need geometry formulas. In order to make our program configurable, we will need a configuration file and this configuration file should be easy to read and modify. For the reusability, we expect our program can product a star graphic every time, without affecting our previous creations. The randomized requirement is pretty straight forward, we can use functions to generate required parameters randomly. And for the plain and easy part, of course we will keep using our favorite Python language.<\/p>\n\n\n\n
Okay, we have a plan according to the above requirements, let’ see what we will have right now:<\/p>\n\n\n\n
\n
Language: Python<\/em><\/li>\n\n\n\n
Libraries: Math <\/em>(for geometry related functions), Turtle <\/em>(for graphic creation), Pillow<\/em> (for graphic output processing), Random<\/em> (the name just says it all)<\/li>\n\n\n\n
Configuration file: YAML<\/em> (because of its high readability) <\/li>\n<\/ul>\n\n\n\n