How to create a star human with C? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to create a star human with C?

I know that how to create star Pyramid, star X, star Square etc. But i don’t create a star human. Anybody help me please.

1st Apr 2019, 9:20 AM
Safiullah anis
Safiullah anis - avatar
5 Answers
+ 9
Here is a template of bathroom sign people - try printing out your design first like one would do with geometric shapes, count the spaces and stars to note how many are in a row, see where circle rectangle and triangle patterns are combined and alternate or taper off, then plan your nested loops against newline breaks to generate the same design. Ascii challenge: Given a character 'M' or 'W' and an integer input, make either template scalable up to your screen width while maintaining proportions. https://code.sololearn.com/c7py48p11Zkn/?ref=app
2nd Apr 2019, 10:02 AM
boneSpider
boneSpider - avatar
+ 9
Understandable, sounds like the next logical step is to produce the same printed design with nested loops and switch cases. Based on user input, how would one generate scalable and proportionate star people like how geometric shapes are made? Here fixed width limits are used in nested for loops, perhaps that can be done by using variables instead of predefined numbers. https://code.sololearn.com/ch9wHWjFbXo8/?ref=app
3rd Apr 2019, 3:50 AM
boneSpider
boneSpider - avatar
+ 5
Safiullah anis, thank you for the ascii challenge. This is my scalable version. I can't help but think there has to be a better and more efficient way to do this, perhaps a typedef struct could be given to functions instead of passing a long list of arguments as parameters. Not sure how to streamline aligned text for all cases, if anyone has an idea on how improve this code please let me know. Thanks! https://code.sololearn.com/cMLX3Lotcm4o/?ref=app
7th Apr 2019, 8:18 AM
boneSpider
boneSpider - avatar
+ 2
Nice work. But i need a program that using loop and case or if-else statements.N is the input variable, where 50<n>1000.
2nd Apr 2019, 2:22 PM
Safiullah anis
Safiullah anis - avatar
+ 1
Thank you bro
3rd Apr 2019, 9:07 AM
Safiullah anis
Safiullah anis - avatar