Wild Dan Hibiki
teh sex0r
- Joined
- Feb 28, 2004
- Messages
- 649
- Gender
- Undisclosed
- HSC
- 2004
dammit i forgot to chuck in seat >1 < 11
don't beat yourself up about it.. the question was worth 6 marks chances are you wont do everything perfect if you didnt validate it (between 1 and 10) you might lose half a mark and another half for something else.. but if you did validate it and didnt do something else you will still get 5 /6Wild Dan Hibiki said:dammit i forgot to chuck in seat >1 < 11
yeah i wrote down 1 and 3. we only needed two errors right?acmilan said:What problems did you guys find for their algorithms, i found 3:
1. It printed only after it exited the loop, meaning it only printed the last row,seat that it checked.
2. It printed array(row,seat) which didnt give the seat and row number but rather whether it was unsold or sold.
3. Once seat = 11, it exited the inner loop and doesnt reenter the inner loop becuase seat is never set back to 1 so remains at 11 all the time so it only checks the first row
lol damn, now did i do that in the exam? i think so. oh well, i'll be happy with anything over 3/6 for that...acmilan said:Yeh but i just happened to find another one. And scorpion unfortunately you made the error in 2 by printing array(row,seat) which would print out "unsold" instead of the actual row and seat.
kahahahahahahaha that's what I didPoP 'n' Fresh said:that algorithm was easy!
it was basically copying their code, fixing the logic error, then for the if statement was:
IF array(row,seat) = "unsold" AND array(row,seat +1) = "unsold"
print array(row,seat), array(row,seat + 1)
End if
note: u had to change the while condition to <= 9, otherwise it would be an error trying to access out of bouns
I wrote 1 and 3 as well. My algorithm was....interesting. I knew it didn't really work but I had the basics and was spending too much time on it anyway, so I moved on. It worked on the same basics principle as theirs, which is what most people have said.acmilan said:What problems did you guys find for their algorithms, i found 3:
1. It printed only after it exited the loop, meaning it only printed the last row,seat that it checked.
2. It printed array(row,seat) which didnt give the seat and row number but rather whether it was unsold or sold.
3. Once seat = 11, it exited the inner loop and doesnt reenter the inner loop becuase seat is never set back to 1 so remains at 11 all the time so it only checks the first row