File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -409,7 +409,33 @@ void cleanup_graphics() {
409409 std::cout << " logo graphics closed" << std::endl;
410410}
411411
412+ int show_usage () {
413+ std::cout << " syntax:" << std::endl;
414+ std::cout << " forward <len> | fd <len>" << std::endl;
415+ std::cout << " back <len> | bk <len>" << std::endl;
416+ std::cout << " right <angle> | rt <angle>" << std::endl;
417+ std::cout << " left <angle> | lt <angle>" << std::endl;
418+ std::cout << " penup | pu" << std::endl;
419+ std::cout << " pendown | pd" << std::endl;
420+ std::cout << " hideturtle | ht" << std::endl;
421+ std::cout << " showturtle | st" << std::endl;
422+ std::cout << " clear | ct" << std::endl;
423+ std::cout << " repeat <count> [ <cmds> ]" << std::endl;
424+ std::cout << " home" << std::endl;
425+ std::cout << " exit" << std::endl;
426+ std::cout << " where <count> : non-negative integer" << std::endl;
427+ std::cout << " <cmds> : chain of valid commands" << std::endl;
428+ std::cout << " <len> : integer" << std::endl;
429+ std::cout << " <angle> : integer in degrees" << std::endl;
430+ return 0 ;
431+ }
432+
412433int main (int argc,char *argv[]) {
434+ if (argc != 1 ) {
435+ // assumes user wants logo --help
436+ return show_usage ();
437+ }
438+
413439 int gd = DETECT, gm;
414440 std::graphics::initgraph (&gd, &gm, NULL );
415441 int gerr = std::graphics::graphresult ();
You can’t perform that action at this time.
0 commit comments