This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
haas:fall2020:c4eng:projects:lob0 [2020/08/21 12:37] – wedge | haas:fall2020:c4eng:projects:lob0 [2020/08/21 12:50] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
< | < | ||
</ | </ | ||
- | ======PROJECT====== | ||
- | PROJECT: Letters of Blocks====== | ||
- | =====Objective===== | + | {{page> |
- | To create a program that generates an image containing a set of letters, made from coordinated blocks. | + | |
- | =====Abstraction===== | ||
- | 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 ' | ||
- | |||
- | Some examples: | ||
- | |||
- | * // | ||
- | * //desig// - different classes have different class designations. To make one universal document pertinent to ALL classes, specific examples will instead use ' | ||
- | * c4eng - ENGR1050 "C for Engineers" | ||
- | * cprog - CSCS1320 "C/C++ Programming" | ||
- | * unix - CSCS1730 " | ||
- | * data - CSCS2320 "Data Structures" | ||
- | * discrete - CSCS2330 " | ||
- | |||
- | This sort of abstraction is very similar to that we will find in our utilization of **variables** in programming, | ||
- | |||
- | Do not be a literalist computer! Start to exercise your abstraction abilities. | ||
- | |||
- | =====Locational Awareness===== | ||
- | This document is written with TWO locations in mind: | ||
- | |||
- | * lab46 (the system you may retrieve resources and SUBMIT projects) | ||
- | * your pi (the system you will transfer resources to/from, and WORK ON/COMPLETE projects) | ||
- | |||
- | 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: | ||
- | |||
- | * YOU cannot install software on lab46. You don't have access. | ||
- | * projects CANNOT be SUBMITTED on your pi. | ||
- | |||
- | =====Reading===== | ||
- | Please be sure to familiarize yourself with the following content in " | ||
- | |||
- | * [[https:// | ||
- | * [[https:// | ||
- | * [[https:// | ||
- | |||
- | =====Background===== | ||
- | For this project, you will be using a graphics design library to render the indicated image. | ||
- | |||
- | =====Program===== | ||
- | 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: | ||
- | |||
- | 43x33 | ||
- | |||
- | * 4 letters/ | ||
- | * each symbol is a unique render (if you had 2 letter M's, both M's should look different) | ||
- | * the 4 symbols are arranged to comfortably fit within a canvas of 1280x1024 pixels | ||
- | * the image will utilize no fewer than 8 different colours | ||
- | * letters are to be entirely constructed out of blocks (filled but square rectangles), | ||
- | |||
- | Symbols could be your initials, plus extra to fill up to 4 total symbols. | ||
- | |||
- | Restrictions: | ||
- | |||
- | * I don't want to see all simple letters (4 L's, 4 I's, etc.) | ||
- | |||
- | ====On your pi==== | ||
- | 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: | ||
- | |||
- | * **build-essential** (hopefully you took care of this in ntr0) | ||
- | * **libgd-dev** | ||
- | * **libgd-tools** | ||
- | * **libgd3** | ||
- | |||
- | =====Specifications===== | ||
- | Your program should: | ||
- | |||
- | * have valid, descriptive variable names of length //no shorter than// 4 symbols | ||
- | * have consistent, well-defined indentation (no less than 4 spaces per level of indentation) | ||
- | * all code within the same scope aligned to its indentation level | ||
- | * have proximal comments explaining your rationale and what is going on, throughout your code | ||
- | * perform the intended operation, outputting the correct/ | ||
- | * at the end of your main() function, use a single return statement to conclude your code, return a 0 indicating successful operation | ||
- | |||
- | =====Grabbing project resources===== | ||
- | I have prepared a **grabit** for resources related to this project. To obtain: | ||
- | |||
- | <cli> | ||
- | lab46: | ||
- | make: Entering directory '/ | ||
- | '/ | ||
- | '/ | ||
- | make: Leaving directory '/ | ||
- | lab46: | ||
- | </ | ||
- | |||
- | At which point you can change into the newly created and populated **lob0** directory. | ||
- | |||
- | =====Compiling===== | ||
- | 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** | ||
- | |||
- | =====Restrictions===== | ||
- | To ensure a level playing field (should some happen to have some programming experience), | ||
- | |||
- | * selection statements of any kind (you' | ||
- | * loops of any kind (place everything manually, the benefit is exposing yourself to the problem) | ||
- | |||
- | =====Strategy===== | ||
- | 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: | ||
- | |||
- | * START EARLY: perhaps even while you are working on week 2's " | ||
- | * decide what letters/ | ||
- | * practice plotting them out, figuring out which " | ||
- | * determine what a good ratio of blocks to screen size would be (holding a 11" | ||
- | * Figure out what blocks you need to fill in order to "best fit" your symbols within the allocated space (ie the sheet of graph paper representing your image size) | ||
- | * mark up your appropriately sized and filled out symbols with the different colors the project calls for | ||
- | * ONCE you have worked out your scheme by hand, you can THEN proceed to start playing with the provided code | ||
- | * determine what shapes are being rendered (view it in a web browser or image viewer) | ||
- | * make changes to the shapes. Experiment and develop an understanding of the coordinate system and how you can predictably impact the shape as it is rendered in the image | ||
- | * once you understand how to manipulate the shapes, remove the demo shapes and start laying down your own shapes | ||
- | * the provided code infrastructure may not be adequate for the demands of the project, and will need to be **expanded** in some areas | ||
- | * see if you understand the patterns of the existing infrastructure, | ||
- | * ASK QUESTIONS so as to maintain an understanding of what is going on | ||
- | |||
- | =====How to view the picture===== | ||
- | Depending on your computing setup, choose the most practical means of viewing your program' | ||
- | |||
- | ====Raspberry Pi desktop==== | ||
- | 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 **~/ | ||
- | |||
- | Rinse and repeat as you go through revisions. | ||
- | |||
- | ====Raspberry Pi command-line via SSH/ | ||
- | You don't have a monitor, so you are logging into your pi remotely (doable, and good intra-system practice) | ||
- | |||
- | Once your **Makefile** and **lob0.c** file are added to your repository, **commit** and **push**. | ||
- | |||
- | On lab46, **pull** and **update**. | ||
- | |||
- | Compile: | ||
- | |||
- | <cli> | ||
- | lab46: | ||
- | </ | ||
- | |||
- | and run your program: | ||
- | |||
- | <cli> | ||
- | lab46: | ||
- | </ | ||
- | |||
- | ... which will produce an image (**lob0.png**); | ||
- | |||
- | <cli> | ||
- | lab46: | ||
- | lab46: | ||
- | </ | ||
- | |||
- | Then, point a web browser at the following URL: | ||
- | |||
- | * https:// | ||
- | |||
- | NOTE: sometimes the web browser caches previous results, you may have to refresh a few times on revisions to get changes to manifest. | ||
- | =====Submission===== | ||
- | To successfully complete this project, the following criteria must be met: | ||
- | |||
- | * Code must compile cleanly (no notes, warnings, nor errors) | ||
- | * Output must be correct, and match the form given in the sample output above. | ||
- | * Code must be nicely and consistently indented | ||
- | * Code must be well commented | ||
- | * Do NOT double space your code. Group like statements together. | ||
- | * Output Formatting (including spacing) of program must conform to the provided output (see above). | ||
- | * Track/ | ||
- | * Submit a copy of your source code to me using the **submit** tool. | ||
- | |||
- | To submit this program to me using the **submit** tool, run the following command at your lab46 prompt: | ||
- | |||
- | <cli> | ||
- | lab46: | ||
- | Submitting c4eng project " | ||
- | -> lob0.c(OK) | ||
- | |||
- | SUCCESSFULLY SUBMITTED | ||
- | </ | ||
- | |||
- | 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:post picture of prototype to #c4eng discord channel [6/6] | ||
- | *:lob0:post picture to #c4eng by Sunday before deadline [1/1] | ||
- | *: | ||
- | *:lob0:code is pushed to lab46 repository [6/6] | ||
- | *:lob0:no negative compiler messages for program [6/6] | ||
- | *: | ||
- | </ | ||
- | |||
- | Additionally: | ||
- | * Solutions not abiding by spirit of project will be subject to a 25% overall deduction | ||
- | * Solutions not utilizing descriptive why and how comments will be subject to a 25% overall deduction | ||
- | * Solutions not utilizing indentation to promote scope and clarity will be subject to a 25% overall deduction | ||
- | * Solutions not organized and easy to read are subject to a 25% overall deduction |