Computer Science 126 |
>= 90 A+ 10 21 80-89 A 9 732 76-79 A- 8 7754433322111000 70-75 B+ 7 9988876655544444322211111 65-69 B 6 999999877776665555544443332222222211110000 60-64 B- 5 99988887777765554444322211000 50-59 C+ 4 743310 45-49 C 3 87611 40-44 C- 2 3 30-39 D 129 scores 65.2 average 65 median <= 29 FIf you have questions about your grade, send email to drh@cs. I'll be out of town from 1/23-2/9, but I will be reading email. Do a
finger -l
drh@cs
to see my schedule.M | 1/6 | 10:30-12 | Kostas Tsioutsiouliklis, 317 | 1/13 | 10:00-11:30 | Patricia Burns, 416 | |
Tu | 1/7 | 10:00-12 | Mariusz Jakubowski, 412 | 1/14 | 10:00-12:00 | Mariusz Jakubowski, 412 | |
W | 1/8 | 10:30-12 | Kostas Tsioutsiouliklis, 317 | 1/15 | 10:00-11:30 | Patricia Burns, 416 | |
Th | 1/9 | 10:30-12 | Yefim Shuf, 412 | 1/16 | 3:00-4:30 | Claire Lin, Equad B227 | |
F | 1/10 | 10:30-12 | Yefim Shuf, 412 | 1/17 | 3:00-4:30 | Claire Lin, Equad B227 |
Your score for assignment 10 will be computed as A10 + max(A10,A12), where "A10" is your score on the first submission and "A12" is your score on the second submission. So, if you're confident about your original submission, do nothing! If you'd like a chance to improve your score, polish up your program and submit it again; you have nothing to loose. Here's the exciting part: You won't know A10 before you must submit your second attempt!/u/cs126/bin/submit 12 readme eval.c table.c
chmod
700 .
" once the next time you log in, your files will be
protected. Also, if you add the line "umask 077
" to your
.cshrc
file, only you will be able to access files you create./u/cs126/examples/rat1.h
and /u/cs126/examples/rat1.c
illustrate passing and returning structures by value./u/cs126/bin/lcc
now does it all!/u/cs126/bin/lcc
now automatically looks in /u/cs126/examples
,
/u/cs126/include
, and /u/cs126/lib
for include
files, source files, object files, and libraries. If you add /u/cs126/bin
to your path, you'll never give another lcc
-I
option. For example, to compile and load /u/cs126/examples/{sort3,intlist,quicksort}.c
,
which form the example shown in lecture 15, all you
need is
And, you can compile your% lcc sort3.c quicksort.c intlist.c /u/cs126/examples/sort3.c: /u/cs126/examples/quicksort.c: /u/cs126/examples/intlist.c:
gridclose.c
and /u/cs126/examples/print.c
with the command
% lcc gridclose.c print.c gridclose.c: /u/cs126/examples/print.c:
lcc
You can execute this again by typing just "% lcc -I/u/cs126/examples wf.c /u/cs126/examples/getword.c
!lcc
" (read this
as "bang lcc"); this causes the shell to run the last command that
started with "lcc
"./u/cs126/bin/lcc
instead of /usr/princeton/bin/lcc
.
/u/cs126/bin/lcc
automatically looks in /u/cs126/include
and /u/cs126/examples
for include files, and it automatically
searches
/u/cs126/lib/libmisc.a
when it builds an a.out
.
Thus, the command above can be replaced by
And you can re-run this command with "% /u/cs126/bin/lcc wf.c /u/cs126/examples/getword.c
!?lcc
" (see Hahn, p.
144). Finally, you can omit the /u/cs126/bin
if you add /u/cs126/bin
to your path./u/cs126/bin/toy1.14
's new -l
option prints a "load
trace" as your program is loaded into memory.http://www.cs.princeton.edu/courses/cs126/assignments/
N.htm
where N is the assignment number (note the missing "l
"
in ".html
"). You can peek ahead by opening these URLs
with your browser. But don't invest too much effort in getting aheadassignments
can change dramatically before they are "published" on the
Assignments page, and you're responsible for the
published version.faces
on page 6-6 in
lecture 6 is incorrect; it should be the same
as on page 6-5. Also, as suggested by a student during lecture and in Sec. 7.10
of Deitel and Deitel, it is possible to use card%4
to represent
the suit for card
instead of card/13
, where card
is an integer 0..51. Using card/13
is equivalent to filling the "representation
matrix" row-by-row:
UsingA 2 3 4 5 6 7 8 9 10 J Q K Hearts 0 1 2 3 4 5 6 7 8 9 10 11 12 Diamonds 13 14 15 16 17 18 19 20 21 22 23 24 25 Clubs 26 27 28 29 30 31 32 33 34 35 36 37 38 Spades 39 40 41 42 43 44 45 46 47 48 49 50 51
card%4
is equivalent to filling this matrix column-by-column:
A 2 3 4 5 6 7 8 9 10 J Q K Hearts 0 4 8 12 16 20 24 28 32 36 40 44 48 Diamonds 1 5 9 13 17 21 25 29 33 37 41 45 49 Clubs 2 6 10 14 18 22 26 30 34 38 42 46 50 Spades 3 7 11 15 19 23 27 31 35 39 43 47 51
That is, use Si, not Sj. In the key initialization loop, the assignment to j should readj (j + Si) mod 256
That is, use Si and Ki, not Sj and Kj.j (j + Si + Ki) mod 256
/u/cs126/examples/testrandom.c
,
which uses the random
function. Notice that testrandom.c
includes random.h
; you can compile testrandom.c
and
random.c
with the command
(You might get a diagnostic aboutlcc /u/cs126/examples/{testrandom,random}.c
random
's type; you can ignore it.)readme
file for submitting
pattern.c
as a fictitious assignment solution.
pattern.c
also includes a comment that illustrates the kind of citation that must
accompany code or techniques used by others./usr/princeton/bin/X11/netscape-3.0 http://www.cs.princeton.edu/courses/cs126/ &If you have
/usr/princeton/bin/X11
in your path, you can omit the
path name above and just type netscape-3.0
... See the
Help! page for instructions on how to configure
Netscape 3.0 to use the Acrobat plug-in for browser the lecture slides.Answers to quiz 1: 1. b 2. b 3. d 4. e 5 b. 6.
e 7. c 8. c 9. e 10. b 11. e 12. b.
Answers to quiz 2:
1. e 2. c 3. T 4. T 5. T 6. T 7. T 8. T 9. F 10. c 11. F 12. F 13. T 14. F 15.
d 16. T