Thursday, 21 March 2013

csc week #8

for the lecture this week we have learned about how Von Neumann looks like, its basically bus connects ALU/control to memory (RAM) and I/O keyboard, monitor, storage. and how computer store information ( hard-drive, flash memory, CD etc)

and for week 8 to 10 we were working on the same topic-recursion.

for example : g : number -> image
(define (g d)
(cond
[(> d 0)
(overlay
(beside (g (- d 1)) (g (- d 1)))
(square (* 2 (image-width (g (- d 1)))) "outline" "green"))]
[else (square 10 "outline" "green")]))

the above command is trying to produce an image with condition "d (a solid number) bigger than 0"

if you put 0 instead of d, than it will produce " square 10 "outline" "green" " because for everything

less or equal to 0, that's under the condition [else (square 10 "outline" "green")]

if you put 1 instead of d it will gives you:

1) 2 (square  10 "outline" "green") besides each other

2) a bigger size of a square : (square (* 2 (image-width (g (0)))) "outline" "green")

3) and they overlay each other.

it looks complicated to me at first, but if you split up everything try to read it line by line, figure out

what each line is doing what, then everything becomes easy.

We have done lots of similar problems for the past 2 weeks (week 9 and 10) I am pretty confidence

for how to handle this type of problem.


Tuesday, 5 March 2013

csc 104 week 7

this is a blog for week 7..
for the lecture this week, we basically talked about addition and multiplication of binary numbers..
this is not a hard but interesting topic, just to remember 1+1=0 and carry the 1 over!
it tells me how the computer calculate numbers..
same as sound and picture, both could be simulated using a stream of numbers (language that computer could recongnize) and convert them into arrays of glowing pixels...
Again, its all about algorithm and thats what this course all about...
(lecture materials were not hard so far but the project 1 is killing me!!)