Corning Community College
CSCS1320 C/C++ Programming
PROJECT: Letters of Blocks (lob0)
To adapt and experiment with a program that generates an image containing a set of letters, made from coordinated blocks.
Also to start some time-sensitive activities to ensure ground is broken on the project before the day it is due (see submission rubric below)
As an exercise in toning your abstraction abilities (literally seeing one thing, but understanding and using it as something else), there will be a number of 'generic' terms used throughout this (and other) documents throughout the course, requiring you to substitute in the pertinent information (else face confusion or error).
Some examples:
This sort of abstraction is very similar to that we will find in our utilization of variables in programming, where we can have a “name”, but the data associated with it can change based on various conditions.
Do not be a literalist computer! Start to exercise your abstraction abilities.
This document is written with TWO locations in mind:
There are commands you can ONLY run on one system or the other. Pay attention to any prompt cues in the given examples (or section headings, context of language leading up to any examples).
For example:
Please pay attention to your prompt, so you can perform the needed activity on the correct system.
Please be sure to familiarize yourself with the following content in “the C book”:
For this project, you will be using a graphics design library to render the indicated image.
It is your task to write a program that generates an image containing the representation of a set of letters, in the current directory as your source code and binary, named and accessible as lob0.png
The program will be an exercise in exploration: you will be given some example code that does something. You should poke at it to gain deeper understanding. Then you will, taking out the demo graphics, lay out a set of letters:
Restrictions:
Develop and test this program on your pi. Only when done, verify that it compiles on lab46.
To utilize the needed functionality for this project, you will need to ensure you have the following packages installed:
Your program should:
I have prepared a grabit for resources related to this project. To obtain:
lab46:~/src/SEMESTER/desig$ grabit desig lob0 make: Entering directory '/var/public/SEMESTER/desig/lob0' '/var/public/SEMESTER/desig/lob0/Makefile' -> '/home/user/src/SEMESTER/desig/lob0/Makefile' '/var/public/SEMESTER/desig/lob0/lob0.c' -> '/home/user/src/SEMESTER/desig/lob0/lob0.c' make: Leaving directory '/var/public/SEMESTER/desig/lob0' lab46:~/src/SEMESTER/desig$
At which point you can change into the newly created and populated lob0 directory.
Be sure to add, commit, and push this to your lab46 clone of your repository.
Then, on your pi, pull and update to get the files available there.
Since the grabit brought in a Makefile, you can compile your code simply by typing: make
Any compiler errors will go into a text file called errors
To do a full cleaning, run: make clean then make (or make debug)
If you'd like to see compiler messages as you compile, run: make debug
When done and ready to submit, on lab46: make submit
To ensure a level playing field (should some happen to have some programming experience), I would like to restrict you from using:
As with any process you are looking to describe or automate (in this case, both), if YOU do not personally understand or appreciate the steps involved, you are going to have a hard time communicating a proficient list of instructions to the computer to carry out.
So, the FIRST order of business would be to, BY HAND, ON A SHEET OF GRAPH PAPER (consider this your PROTOTYPE):
Depending on your computing setup, choose the most practical means of viewing your program's image output:
You've got a monitor and keyboard hooked up to your pi that you are using (preferred method for class).
Open a file browser, web browser, or image viewer and navigate to/open up your lob0.png image in your ~/src/SEMESTER/desig/lob0/ directory.
Rinse and repeat as you go through revisions.
You don't have a monitor, so you are logging into your pi remotely (doable, and good intra-system practice)
We start by running a successfully-compiled lob0:
yourpi:~/src/SEMESTER/desig/lob0$ ./lob0
… which will produce an image (lob0.png); You want to put this in your web space (with the proper permissions set), so you can view it in a web browser:
yourpi:~/src/SEMESTER/desig/lob0$ scp lob0.png yourusername@lab46.g7n.org:public_html/
Note that you will be prompted for your lab46 password.
Then over on lab46, run this:
lab46:~$ chmod 0644 ~/public_html/lob0.png
Then, point a web browser at the following URL:
NOTE: sometimes the web browser caches previous results, you may have to refresh a few times on revisions to get changes to manifest.
To successfully complete this project, the following criteria must be met:
To submit this program to me using the submit tool, run the following command at your lab46 prompt:
lab46:~/src/SEMESTER/desig/lob0$ make submit
You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches.
What I'll be looking for:
26:lob0:final tally of results (26/26) *:lob0:post picture of prototype to #desig discord channel [6/6] *:lob0:post picture to #desig by Sunday before deadline [1/1] *:lob0:grabit the code on lab46 by Sunday before deadline [1/1] *:lob0:code is pushed to lab46 semester repository [6/6] *:lob0:no negative compiler messages for program [6/6] *:lob0:proper output formatting per specifications [6/6]
Additionally: