GRID401.CPP: a C++ graphics framework program: nifty tools
Brian Shelburne
Abstract
Brian Shelburne
Abstract
In the Comp 150 Computer Programming I course taught at Wittenberg University, I provide students with a simple graphics frame work program which allows them to write C++ code that generates graphic output. The frame work consists of a 401 x 401 grid, three buttons (Draw, Clear, and Quit) and a simple set of graphic primitives to draw a line, plot a point, set the current color, etc. Students write the code for their own main function, called myMain(), which is called when the Draw button is clicked. The intent is to provide a graphics framework on which to demonstrate various programming techniques, not to teach computer graphics, although by necessity some computer graphics is covered. The Grid401.cpp framework is used both in labs and for programming assignments. Below is a partial list of Grid401.cpp uses 1. Turtle graphics -- counting loops 2. The Sierpinski gasket -- midpoint functions; pseudo-random number generator 3. Drawing rosettes -- using arrays for coordinates 4. Drawing a Greek temple -- functions for rectangles, triangles, circles 5. Drawings using polylines -- reading text files 6. Graphing Functions - 7. Mandelbrot Set -- an application using a complex class 8. Game of Life -- 2 dimensional arrays
A significance statement is not available in the OpenAlex record.
A contribution statement is not available in the OpenAlex record.
Method details are not available in the OpenAlex metadata.
Findings are not separately available in the OpenAlex metadata.
Limitations are not available in the OpenAlex metadata.
Application details are not available in the OpenAlex metadata.
In the Comp 150 Computer Programming I course taught at Wittenberg University, I provide students with a simple graphics frame work program which allows them to write C++ code that generates graphic output. The frame work consists of a 401 x 401 grid, three buttons (Draw, Clear, and Quit) and a simple set of graphic primitives to draw a line, plot a point, set the current color, etc. Students write the code for their own main function, called myMain(), which is called when the Draw button is clicked. The intent is to provide a graphics framework on which to demonstrate various programming techniques, not to teach computer graphics, although by necessity some computer graphics is covered. The Grid401.cpp framework is used both in labs and for programming assignments. Below is a partial list of Grid401.cpp uses 1. Turtle graphics -- counting loops 2. The Sierpinski gasket -- midpoint functions; pseudo-random number generator 3. Drawing rosettes -- using arrays for coordinates 4. Drawing a Greek temple -- functions for rectangles, triangles, circles 5. Drawings using polylines -- reading text files 6. Graphing Functions - 7. Mandelbrot Set -- an application using a complex class 8. Game of Life -- 2 dimensional arrays
Key concepts: Computer science, Graphics, Computer graphics (images), Set (abstract data type), Code (set theory), Sierpinski triangle, Simple (philosophy), Point (geometry)