How to use Code Crunch

0. Overview

Code Crunch is an automatic marking system that allows you to check for the correctness of your program output. For each take-home lab, the given tasks will be set up on Code Crunch. After finishing writing (and testing) your program on your computer, you can upload it to Code Crunch and see how many test cases it passes.

Note that this system is only used for take-home labs, and not sit-in labs or mini PEs.

The overall usage of Code Crunch can be seen as follows.

 

Logging in

Code Crunch

Selecting

a course

Selecting

a task

Reading &

solving a task

Submitting

a program

Reviewing a submission

 

 

1. Logging in Code Crunch

You may access Code Crunch via CS1010E website http://www.comp.nus.edu.sg/~cs1010e/, under Code Crunch tab, “Code Crunch system”. Alternatively, you may log in directly at https://codes.comp.nus.edu.sg. The following screen will be seen. Use your NUSNET ID and password to log in.

 

 

2. Selecting a course

After logging in, you should see a welcome screen. Go to “My Courses” and click on “View” corresponding to CS1010E.

 

 

3. Selecting a task

The tasks list will appear. Note that “Browse Tasks” and “Browse Tutorials” tabs do not lead you to the course tasks list. You should not need to use those two tabs for this course.

Select the task you want to work on.

 

 

4. Reading & solving a task

You should read and understand the task description carefully. Write your solution in the environment given. For CS1010E, you may write and compile your program in cygwin, a Unix-like environment. Please read through the guide under “Getting Started” tab for more details.

Note that writing programs cannot be done on Code Crunch.

 

In some tasks, you may need to download a skeleton program and save it to a folder in cygwin. A guide on how to navigate folders and files in cygwin can be seen in Appendix A.

 

 

5. Submitting a program

Once you finish writing and testing your program on your computer (in cygwin), you can scroll down the task description page to see “Submission” section. Each task has a deadline, after which the “Submission” section will be closed. Hence please attempt it before the given deadline.

Click on the “Browse” button and select your solution file to upload. If you have not known how to locate your file in cygwin, please see Appendix A.

Note that you should only submit your source code, which should have .c extension in this course. Do not submit your executable file, which may have .exe or .out extension.

 

Once the upload complete box appears, you can click “Submit”. You may notice that your source codes are typically very small in size and the upload is finished instantly. If it takes long to upload, please double check the file you select.

 

After submitting, you should see a green box indicating that your code has been submitted successfully. Click on “My Submissions” to see the grade awarded for your programs.

 

 

6. Reviewing a submission

If you have been awarded an A, then congrats, you have completed the lab successfully!

 

If you did not succeed, check the test output. Was your program compiled successfully?

 

If it was compiled successfully, does its output match the expected output exactly? For the test cases below, can you tell why the output is wrong?

 

You must be very careful with your output. Penalty will be given if your output does not match the required output in the task exactly.

 

Code Crunch is very clear and easy to use. Good luck and have fun practicing!

 

Appendix A: How to navigate your files and folders in cygwin

If you have extracted cygwin to the root directory of your drive, for e.g. G:\, there should be two files, cygwin.bat and cygwin.command, and a subfolder cygwin in G:\cygwin. (as you may have known from the Getting Started guide, cygwin.bat is the file you should run to start cygwin).

 

Inside G:\cygwin\cygwin, you will see a number of folders, one of which is home. This is where you reside when you first start cygwin. You may double check this by typing “ls” command in cygwin to view the content of the home folder.

Windows Explorer

 

cygwin environment

 

 

In general, your ~ folder (which is also home folder) in cygwin corresponds to G:\cygwin\cygwin\home.

With this in mind, you should be able to use Windows Explorer to navigate the location in cygwin that you want to download/upload your file to/from.