User Tools

Site Tools


haas:fall2022:cprog:projects:sam0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
haas:fall2022:cprog:projects:sam0 [2022/10/16 15:05] – [Program] wedgehaas:fall2022:cprog:projects:sam0 [2022/10/16 15:12] (current) – [Submission] wedge
Line 142: Line 142:
 lab46:~/src/SEMESTER/DESIG/sam0$  lab46:~/src/SEMESTER/DESIG/sam0$ 
 </cli> </cli>
 +
 +=====Pseudocode=====
 +
 +====encode====
 +Your encode may end up flowing something like the following:
 +
 +<code>
 +MODULE ENCODE (RECEIVES MESSAGE AND KEY):
 +    LOOP THROUGH EACH CHARACTER IN THE MESSAGE:
 +        CHARACTER IS SET TO NUMERIC VALUE OF CHARACTER PLUS THE KEY
 +        SHOULD THE CHARACTER EXCEED THE RANGE OF DISPLAYABLE CHARACTERS:
 +            RESET CHARACTER TO START OF RANGE PLUS REMAINING OFFSET OF KEY
 +        SHOULD THE CHARACTER GO BELOW THE RANGE OF DISPLAYABLE CHARACTERS:
 +            RESET CHARACTER TO END OF RANGE MINUS REMAINING OFFSET OF KEY
 +
 +        SET MODIFIED CHARACTER TO RESULT MESSAGE
 +    END LOOP
 +    SEND BACK RESULT MESSAGE
 +END MODULE
 +</code>
 +
 +====decode====
 +<code>
 +MODULE DECODE (RECEIVES MESSAGE AND KEY):
 +    LOOP THROUGH EACH CHARACTER IN THE MESSAGE:
 +        CHARACTER IS SET TO NUMERIC VALUE OF CHARACTER MINUS THE KEY
 +        SHOULD THE CHARACTER EXCEED THE RANGE OF DISPLAYABLE CHARACTERS:
 +            RESET CHARACTER TO START OF RANGE PLUS REMAINING OFFSET OF KEY
 +        SHOULD THE CHARACTER GO BELOW THE RANGE OF DISPLAYABLE CHARACTERS:
 +            RESET CHARACTER TO END OF RANGE MINUS REMAINING OFFSET OF KEY
 +
 +        SET MODIFIED CHARACTER TO RESULT MESSAGE
 +    END LOOP
 +    SEND BACK RESULT MESSAGE
 +END MODULE
 +</code>
  
 =====Submission===== =====Submission=====
Line 147: Line 183:
  
   * Code must compile cleanly (no warnings or errors)   * Code must compile cleanly (no warnings or errors)
-    * Use the **-Wall** and **<nowiki>--std=gnu99</nowiki>** flags when compiling.+    * Use the **-Wall** and **<nowiki>--std=gnu18</nowiki>** flags when compiling.
   * Output must be correct, and resemble the form given in the sample output above.   * Output must be correct, and resemble the form given in the sample output above.
   * Code must be nicely and consistently indented (you may use the **indent** tool)   * Code must be nicely and consistently indented (you may use the **indent** tool)
haas/fall2022/cprog/projects/sam0.1665932733.txt.gz · Last modified: 2022/10/16 15:05 by wedge