PDA

View Full Version : Drawing different shapes with script



karlos100
January 23rd, 2017, 09:54 AM
i want to make a script that uses while cycle for creating a menu where the user can choose what kind of shape he wants that the computer draws: square, rectangle, equilateral triangle and rhombus.
And after the user has choosen the shape he wants, than he will be asked the paramters for the shape, like: the side a and side b, the number of of symbols, and so on.
and i would like it to have funktions as rhombus (), triangle () and so on, and it also would have an option to exit as well.
i would like it to have the comments as well to see what is what and what do they do and so on, because i want to learn more about it and it would be a fun way to learn about it. :P
i would be glad if someone can help me, i dont know how to create the script as a whole and get it to work.

thanks btw. :)

TheFu
January 23rd, 2017, 10:33 AM
Sounds like a homework problem. Post some code. Every Unix system has hundreds of scripts on them which show how to do program controls.

You didn't say which scripting language was being used. That is key, since people may not know the language you have chosen and the different types of languages work very differently. There are 500+ different languages - nobody knows them all. http://rosettacode.org/ That link will provide lots of examples too.

karlos100
January 24th, 2017, 01:19 PM
i am using .sh in debian without a graphics induction