MedVision ad

what in the flying fffff was evolution option CDR CONS question (1 Viewer)

Li0n

spiKu
Joined
Dec 28, 2002
Messages
953
Location
not telling
Gender
Female
HSC
2004
WHAT THE FUCK IN THE FLYING NAME OF FUCK DID IT WANT?

CDR
CONS
a,b,c,d
Nick?
Sally
WHATIFKCJE#?>D
`!@


WHAT THE FUCKING FUCK FUCK FUCK? FUCKIG FUCKING FUCK WHAT FUCK THE?


:S:S:S::S:S::S::S::S::S:S:S:S:S:S
 

PoP 'n' Fresh

Poke me! I giggle!
Joined
Aug 23, 2004
Messages
193
Location
Manly
Gender
Male
HSC
2005
it was functional paradigm... list processing... using functions.
quite easy, taking it step by step evaluating it line by line.
throw away marks
 

peeasoup

Member
Joined
Aug 25, 2004
Messages
103
Dude i had no fucking idea with that functional language....I just left that part..
 

PoP 'n' Fresh

Poke me! I giggle!
Joined
Aug 23, 2004
Messages
193
Location
Manly
Gender
Male
HSC
2005
it was like a maths function in a function thing.
u evaluate the inner functions first, and go outwards.
there was clear rules above the question on how to evaluate the functions
 

Terra_Niux

l337 h4x0r
Joined
Feb 5, 2004
Messages
93
Gender
Male
HSC
N/A
Yeah the rules basically gave away the answer to all the questions.
 

Terra_Niux

l337 h4x0r
Joined
Feb 5, 2004
Messages
93
Gender
Male
HSC
N/A
If you want to know whether you got the answer right, pop open a LISP interpreter such as Emacs and whack it in and evaluate it, C-x C-r or some crap :p
 

Terra_Niux

l337 h4x0r
Joined
Feb 5, 2004
Messages
93
Gender
Male
HSC
N/A
In Lisp, car, cdr, and cons are fundamental functions. The cons function is used to construct lists, and the car and cdr functions are used to take them apart.

The cons function constructs lists; it is the inverse of car and cdr. For example, cons can be used to make a four element list from the three element list, (fir oak maple):

(cons 'pine '(fir oak maple))

After evaluating this list, you will see

(pine fir oak maple)

The cdr of a list is the rest of the list, that is, the cdr function returns the part of the list that follows the first item. Thus, while the car of the list '(rose violet daisy buttercup) is rose, the rest of the list, the value returned by the cdr function, is (violet daisy buttercup).

You can see this by evaluating the following in the usual way:

(cdr '(rose violet daisy buttercup))

When you evaluate this, (violet daisy buttercup) will appear in the echo area.


Source: http://www.rattlesnake.com/intro
 

JayWalker

Member
Joined
Mar 19, 2004
Messages
401
Location
Sydney
Gender
Male
HSC
2004
yeah i got that tooo.. ez question.. did u went up with like Sally or somethin? i cant remember
 

PoP 'n' Fresh

Poke me! I giggle!
Joined
Aug 23, 2004
Messages
193
Location
Manly
Gender
Male
HSC
2005
i got sally for the first one, redoing the second one now to make sure i got it right
 

Li0n

spiKu
Joined
Dec 28, 2002
Messages
953
Location
not telling
Gender
Female
HSC
2004
ROFL LMAO!
I GOT IT RIGHT (if your right)

i had nick for i.
because i thought that
because the answer for a CDR would be the same value thing for "b"
so i thought after the 2, CONS would have been the a,b,c,d thing in

meh i had nfi
i just put nick cause i thought he was b
 

kyliej

rOcKiN PuMpKiN
Joined
Aug 26, 2003
Messages
48
Location
in a room in my house =P
Gender
Undisclosed
HSC
N/A
i just put down not attempted..... i mean ive neva touched lisp code... i thought i would have done it in class or something... i looked at it... went wtf.... looked out the window for a bit... then decided i was doomed. i knew it was functional paradigm but i had no idea wat to do with it... oh well... as far as im concerned i was doomed as soon as i went into the test room..... its all good.......
 

Jebu

New Member
Joined
Sep 17, 2004
Messages
16
I had sally for the first one, then Tom and the 3 latter names for the second. Anyone able to confirm actual answer?
 

Terra_Niux

l337 h4x0r
Joined
Feb 5, 2004
Messages
93
Gender
Male
HSC
N/A
I had Sally for the first one and for the second one I had Tom, Cathy, John, Masa Denise but I crossed it out and just wrote Tom, you think if Tom, Catchy, John and Masa is right they'll still give me any marks or not?
 

sig

Member
Joined
Feb 25, 2004
Messages
111
Gender
Male
HSC
2004
from what I interpreted

CDR (2, = b

so


CDR(3, = c?

so I got Tom, John, Masa, Denise
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top