CS35: Project 4

CS35: Programming and Problem Solving
Ray Ontko
Department of Computer Science
Earlham College

Due Friday, 1999/11/12

Choose one of the following programming projects. Read the problem carefully and implement it exactly as described, to the best of your ability. Test it on one or more input files of your choosing. Turn in a print-out of the working program, a print-out of the input file, and a print-out of the output of your program (or, you can send all three to me in an e-mail).

  1. Write a program which produces a word find puzzle from a list of words. Your program should read a list of up to 100 words as input, randomly place the words letter by letter into a 15 x 15 grid, each word in a random direction, and then fill any remaining spaces in the grid with random letters.

    The program should print the grid followed by the list of words. The grid should appear in all uppercase with three blank spaces between each column of letters, and a blank line between each row of letters. The list of words should be sorted alphabetically, case-insensitively.

    You would run your program with a command similar to this:

    $ ./gen_word_find < my_words.txt
    

    For fun, allow the user to specify on the command line the width and height of the grid to be used (up to a maxiumum of 30 x 30).

  2. Write a program which implements a simple turtle graphics simulator as described in Problem 6.23 in Deitel and Deitel.

    Instead of turtle commands '1,2,3,4,5,6,9', consider allowing the user to use the letters 'u,d,r,l,m,p,q' for the commands Pen Up, Pen Down, Turn Right, Turn Left, Move, Print, and Quit.

    You would run your program with a command similar to this:

    $ ./turtle_graphics < my_turtle_program.txt
    

    For fun, allow the user to specify on the command line the width and depth of the floorspace to use (up to a maxiumum of 50 x 50).

Copyright © 1999, Ray Ontko (rayo@ontko.com).