Corning Community College CSCS1320 C/C++ Programming ======Project: NUMBER GAME FUN (ngfX)====== =====Objective===== To create an increasingly detailed program logic that implements and displays a playing field of a defined number/logic game. =====NOTE===== Due to similar descriptions among the range of projects, I have condensed everything into one common project page. Where you see "ngfX" please substitute the particular project you are working on (ie "ngf0", "ngf1", etc.) =====Abstraction===== {{page>haas:spring2023:common:projects:abstraction&noheader}} =====Locational Awareness===== {{page>haas:spring2023:common:projects:location&noheader}} =====Reading===== Please be sure to familiarize yourself with any pertinent content in: * [[https://www.tutorialspoint.com/cprogramming/|C Tutorial]] * [[http://publications.gbdirect.co.uk/c_book/|The C Book, online C book]] * [[http://publications.gbdirect.co.uk/c_book/thecbook.pdf|PDF of above]] * [[/_media/haas/printf.pdf|printf PDF]] * [[https://www.cprogramming.com/tutorial/c-tutorial.html?inl=hp|C tutorial]] * along with any other C programming language information Please familiarize yourself with the table of contents and or index of the various resources, and sample various content to connect yourself with deeper understanding into the concepts being called upon in the current activity. ====On your pi/system==== Develop and test this program on your pi/development system. Only when done, verify that it compiles and runs on lab46, before submitting. 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) * mercurial (also installed and configured in ntr0) NOTE: make sure you, for the purposes of your activities pertaining to this class, that you are using your lab46 SEMESTER repository. =====Specifications===== Your program should: * have valid, descriptive variable names of length //no shorter than// 4 symbols * unless you have whole-word descriptors that happen to clock in at less than 4 symbols (such as "row") * 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/accurate information in indicated format * 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===== To obtain project data, you will need to satisfy the following prerequisites: * be logged into lab46 (shell) as your user * have your semester lab46 repo cloned (into ~/src/SEMESTER) * have created the appropriate DESIG (like "cprog" or "unix") subdirectory therein (~/src/SEMESTER/DESIG) * have changed into that ~/src/SEMESTER/DESIG directory If all those conditions are met, you can use the **grabit** tool to obtain the project, as follows: lab46:~/src/SEMESTER/DESIG$ grabit DESIG ngfX make: Entering directory '/var/public/SEMESTER/DESIG/ngfX' '/var/public/SEMESTER/DESIG/ngfX/Makefile' -> '/home/USER/src/SEMESTER/DESIG/ngfX/Makefile' '/var/public/SEMESTER/DESIG/ngfX/README' -> '/home/USER/src/SEMESTER/DESIG/ngfX/README' '/var/public/SEMESTER/DESIG/ngfX/ngfX.c' -> '/home/USER/src/SEMESTER/DESIG/ngfX/ngfX.c' '/var/public/SEMESTER/DESIG/ngfX/ref_ngfX.aarch64' -> '/home/USER/src/SEMESTER/DESIG/ngfX/ref_ngfX.aarch64' '/var/public/SEMESTER/DESIG/ngfX/ref_ngfX.armv7l' -> '/home/USER/src/SEMESTER/DESIG/ngfX/ref_ngfX.armv7l' '/var/public/SEMESTER/DESIG/ngfX/ref_ngfX.x86_64' -> '/home/USER/src/SEMESTER/DESIG/ngfX/ref_ngfX.x86_64' '/var/public/SEMESTER/DESIG/ngfX/tttX.c' -> '/home/USER/src/SEMESTER/DESIG/ngfX/tttX.c' make: Leaving directory '/var/public/SEMESTER/DESIG/ngfX' lab46:~/src/SEMESTER/DESIG$ At which point you can change into the newly created and populated **ngfX** directory. =====Instructions===== Further instructions are included amongst the project data you obtained via the 'grabit' =====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**; you can view any of these generated compile-time messages by viewing the **error** files: **cat errors** or **less 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 (versus having them go into the **errors** file, run: **make debug** When done and ready to submit, on lab46: **make submit** ====Raspberry Pi/development system command-line via SSH/MOSH==== If you don't have a monitor, you likely are logging into your pi/development system remotely (doable, and good intra-system practice) Once your **ngfX** project files are 'hg' **add**ed to your repository on lab46, **commit** and **push** them there as well. On your pi/development system, to obtain those files there, be sure to be in your cloned repository directory, and 'hg' **pull** and **update**. NOTE: To avoid repository conflicts, ALWAYS check for any incoming pull/update transactions before doing a commit/push. Problems occur when you forget (this is an issue on both lab46 and your pi/development system). Compile: lab46:~/src/SEMESTER/DESIG/ngfX$ make and run your program: lab46:~/src/SEMESTER/DESIG/ngfX$ ./ngfX.ARCH =====Submission===== To successfully complete this project, the following criteria must be met: * Code must compile cleanly (no notes, warnings, nor errors) * Even if it compiles and runs, make sure there are no notes or warnings in the 'errors' file. * A 'make clean' will empty out old messages, so you may want to do that before a final compile to ensure everything is prim and proper. * 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/version the source code in a repository * 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: lab46:~/src/SEMESTER/DESIG/ngfX$ make submit Project backup process commencing Taking snapshot of current project (ngfX) ... OK Compressing snapshot of ngfX project archive ... OK Setting secure permissions on ngfX archive ... OK Project backup process complete Submitting DESIG project "ngfX": -> ../ngfX-DATESTAMP-HOUR.tar.gz(OK) SUCCESSFULLY SUBMITTED lab46:~/src/SEMESTER/DESIG/ngfX$ 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: SCORE:ngfX:final tally of results (SCORE/TOTAL) *:ngfX:obtained via grabit by Sunday before deadline [#/#] *:ngfX:program compiles successfully, no errors [#/#] *:ngfX:program compiles with no warnings [#/#] *:ngfX:program performs stated task/algorithm [#/#] *:ngfX:program output conforms to formatting expectations [#/#] *:ngfX:proper error checking and status reporting performed [#/#] *:ngfX:code implements solution using relevant concepts [#/#] *:ngfX:code updates committed/pushed to lab46 semester repo [#/#] *:ngfX:code uses correct variable types and name lengths [#/#] *:ngfX:project is submitted with relevant and complete source [#/#] *:ngfX:project is submitted on lab46 using 'make submit' [#/#] *:ngfX:code contains adequate, consistent, useful comments [#/#] *:ngfX:runtime tests of submitted program succeed [#/#] 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 lacking **ORGANIZATION** and are not easy to read (within 90 char width) are subject to a 25% overall deduction ^ project (ngfX) ^ point item (#) ^ total points (TOTAL) | | ngf0 | 2 | 26 | | ngf1 | 3 | 39 | | ngf2 | 4 | 52 | | ngf3 | 5 | 65 | | ngf4 | 6 | 78 | | ngf5 | 7 | 91 | | ngf6 | 7 | 91 |