• Best of luck to the class of 2024 for their HSC exams. You got this!
    Let us know your thoughts on the HSC exams here
  • YOU can help the next generation of students in the community!
    Share your trial papers and notes on our Notes & Resources page
MedVision ad

Comp 1011 Assignment 2 (1 Viewer)

Ragerunner

Your friendly HSC guide
Joined
Apr 12, 2003
Messages
5,472
Location
UNSW
Gender
Male
HSC
2003
This Monday....

He said you can get it going decently in 5-6 extra lines....i mean... wtf ?
 

Ragerunner

Your friendly HSC guide
Joined
Apr 12, 2003
Messages
5,472
Location
UNSW
Gender
Male
HSC
2003
writing a function that checks what happens when "pl play"(Action) is a suggestion(use isAccuse)(ie checks wether the suggestion is correct .
ok say i managed to write a function to do that, how would i modify the line lambert gave us to make use of the function?
 

redslert

yes, my actual brain
Joined
Nov 25, 2002
Messages
2,373
Location
Behind You!!
Gender
Male
HSC
2003
ok
you will have to use gaurds to check if it is an accusation, if not it is a suggestion

yes you will have to completely alter the line which is in the stub file

hmmm well that's what i didn't but i'm not even sure if it is right?!

the most important part of the line
(Just (pl, play pl), Nothing, Just (CdG (pls ++ [(pl,cards)]) ans))
is
the rest is use later when you form a proper argument for accuse
 
Last edited:

Ragerunner

Your friendly HSC guide
Joined
Apr 12, 2003
Messages
5,472
Location
UNSW
Gender
Male
HSC
2003
how did u alter it redslert?

I got absolutely no idea...
 

redslert

yes, my actual brain
Joined
Nov 25, 2002
Messages
2,373
Location
Behind You!!
Gender
Male
HSC
2003
oki i guess giving u this small part to start off won't kill
but i'm not even 100% sure that it works because right now i'm not 30% through the programing....

step (CdG ((pl,cards): pls) ans)
| isAccuse (play pl) == True = accBAH
| otherwise = sugBAHBAH
 

cyrax83

discrete is killing me :(
Joined
Nov 18, 2002
Messages
376
Gender
Male
HSC
2003
instead of saying we couldn't do it, lets say we wanted to be radiculs and protested to this bullshit assignment because of it's bullshitten-tecity (yes i know thats not a word)
 

Ragerunner

Your friendly HSC guide
Joined
Apr 12, 2003
Messages
5,472
Location
UNSW
Gender
Male
HSC
2003
I liked the way how he said a few lectures ago that "This is actually pretty easy".....then the everyone started laughing.......

I can't wait for Haskell to be over. Only a few more weeks...
 

Constip8edSkunk

Joga Bonito
Joined
Apr 15, 2003
Messages
2,397
Location
Maroubra
Gender
Male
HSC
2003
Originally posted by Ragerunner
how did u alter it redslert?

I got absolutely no idea...
theres 2 basic ways to approach step, one is to divide step into correct accusation, wrong accusation, suggestions etc and provide the output triple for each case(using guards). the other is to approach the triple in as 3 parts and apply the different conditions to them separately(using guards ....and lots of subfunctions/where clauses).



Originally posted by redslert
oki i guess giving u this small part to start off won't kill
but i'm not even 100% sure that it works because right now i'm not 30% through the programing....

step (CdG ((pl,cards): pls) ans)
| isAccuse (play pl) == True = accBAH
| otherwise = sugBAHBAH
you can just write isAccuse (play pl) = accBAH
 

redslert

yes, my actual brain
Joined
Nov 25, 2002
Messages
2,373
Location
Behind You!!
Gender
Male
HSC
2003
i died

lol tim lambert replies to posts on the cse forum at 2.20am

doesn't any body sleep!?
 

redslert

yes, my actual brain
Joined
Nov 25, 2002
Messages
2,373
Location
Behind You!!
Gender
Male
HSC
2003
lol i found out so many people haven't even started yet....
also only half the people turned up today for the lecture and the labs were jam packed!
 

Ragerunner

Your friendly HSC guide
Joined
Apr 12, 2003
Messages
5,472
Location
UNSW
Gender
Male
HSC
2003
I was the one that left the lecture as soon as he finished talking about the assignment :D
 

Ragerunner

Your friendly HSC guide
Joined
Apr 12, 2003
Messages
5,472
Location
UNSW
Gender
Male
HSC
2003
ConstipatedSkunk, can you give me a list of all the functions you made?

Not the code, just the function name so I know what I need to make myself..

e.g.

checkName
checkSuggestion

etc....
 

redslert

yes, my actual brain
Joined
Nov 25, 2002
Messages
2,373
Location
Behind You!!
Gender
Male
HSC
2003
OMG I FINISHED!!!!!!!

OMG OMFG!!

i can't believe it!!

TOOK LIKE JUST FUKIN 3days and NIGHTS!

so HAPPPY! :p

ok rage i can help you out now!!
 

redslert

yes, my actual brain
Joined
Nov 25, 2002
Messages
2,373
Location
Behind You!!
Gender
Male
HSC
2003
i have a total of 12 function
right now....but this is going to change as i'm going to have to fix my style now!

i have

newGame
mkaeAlive
step
orderPlayers
checkAliveAll
accusation
informNoDisprover
suggestion
informDisprover
getNames
getDisprove
checkSuggestion


as i said this is going to change...right now my style is really bad!

that's the order which it is currently in my program....
try not to copy...hmmm not try.....DON'T copy
 
Last edited:

redslert

yes, my actual brain
Joined
Nov 25, 2002
Messages
2,373
Location
Behind You!!
Gender
Male
HSC
2003
hmmm after typing up that list i think my variable names are so freekin bad

going to have to change them
 

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

Top