Hey there! Sign in to join this conversationNew here? Join for free
    Offline

    2
    ReputationRep:
    (Original post by archiebaker)
    How did everyone find setting the "H" and the "C" into the middle or outer of the board?
    In Python3, this was my solution:

    def SetUpGameBoard(Board, Boardsize):
    for Row in range(1, BoardSize + 1):
    for Column in range(1, BoardSize + 1):
    if (Row == 1 and Column==1) or (Row==Boardsize and Column==Boardsize):
    Board[Row][Column] = "H"
    elif (Row==1 and Column==Boardsize) or (Row==Boardsize and Column==1):
    Board[Row][Column] = "C" else: Board[Row][Column] = " "
    Offline

    1
    ReputationRep:
    (Original post by the_chosen_one97)
    In Python3, this was my solution:

    def SetUpGameBoard(Board, Boardsize):
    for Row in range(1, BoardSize + 1):
    for Column in range(1, BoardSize + 1):
    if (Row == 1 and Column==1) or (Row==Boardsize and Column==Boardsize):
    Board[Row][Column] = "H"
    elif (Row==1 and Column==Boardsize) or (Row==Boardsize and Column==1):
    Board[Row][Column] = "C" else: Board[Row][Column] = " "
    I was using VB but my solution looked very similar
    Offline

    0
    ReputationRep:
    (Original post by JamesGlackin)
    Everyone got 278 for the 8 bit twos complement denary to binary right?
    I got that too!!
    Offline

    11
    ReputationRep:
    Think their both wrong
    Offline

    2
    ReputationRep:
    Guys Two's complement is a way of representing negative numbers - using 8 bits its range is from -128 to +127. The MSB is the sign bit which was a 1 - the place value was -128. It is not possible to obtain a positive value from this - the answer is -76
    Offline

    0
    ReputationRep:
    Decent exam, might only get a mid A though, made stupid silly mistakes.

    Got the sample size wrong as I misread the audio frequency as 8000Hz, oops
    Forgot what a gatherer was
    Not sure about what I got for the two's complement but -78 doesn't ring a bell. Getting binary wrong would kill me
    I spent at least 12-15 minutes figuring out what the algorithm does but to no avail
    Got the FSM question about adding a 5p as 4 instead of 5.

    All the programming questions were relatively easy and I just managed to finish, just need to focus on COMP3 and COMP2 now
    Offline

    2
    ReputationRep:
    (Original post by ubiquitousking)
    I can't remember the question but isn't the range of 8-bit two's complement
    -128 to 127?

    So how is a conversion resulting in a value above 127?
    You're correct - I think some people may have forgot about the sign bit
    Offline

    0
    ReputationRep:
    does anyone remember what the binary was?
    Offline

    2
    ReputationRep:
    (Original post by xAlien_)
    does anyone remember what the binary was?
    Im pretty sure it was: 10110100
    Offline

    0
    ReputationRep:
    I can't remember whether I put -77 or -76. I have a sick feeling that I put -77

    I'm not retaking COMP2 but need some more UMS; so let us pray and hope for some miracle grade boundaries similar to last year.

    Or scream into the public static void.
    Offline

    0
    ReputationRep:
    (Original post by the_chosen_one97)
    Im pretty sure it was: 10110100
    Yikes definitely-76 then. Have a bad feeling I missed the 32 and put the answer as -108 -_-
    Offline

    1
    ReputationRep:
    much easier than last years paper, grade boundaries will be relatively higher i reckon
    Offline

    2
    ReputationRep:
    (Original post by KnightCode)
    Done, Pretty good exam.
    Couldn't be asked to work out what 1600 (i think) X 2 x 20 was xD
    I managed to do the last question , however it didnt work.
    For the last question i did a nested loop with rows and columns then a if condition inside the nested loop that check if flip is possible then print them out.
    Possibly lost around 7-8 marks max.

    Hope it was good for u guys too!!
    For the last question all you had to do was make board(i, j) = "H" before checking it. Because it will always return false when the start square is blank. (if you did " for i = 1... and for j = ..... loops).

    Someone told me after the exam, it was only 1 line of code so think I'll get 10/12 or around there for last q.
    Offline

    1
    ReputationRep:
    Does anyone have the code for the last question? I think I was close but I couldn't get it to work
    Offline

    1
    ReputationRep:
    (Original post by UsmanM)
    The code had 3 calls to that function, you needed 4 for all 4 diagonals from the square. (I.e. Top right, top left, bottom right, bottom left) but they were only 3. And one of them was 0, 0 so was checking if it could move nowhere.

    That's what I got.
    you for got about that it didn't have the board parameter in the function. how would it detect what pieces to flip if it doesn't have the board as a parameter
    Offline

    2
    ReputationRep:
    That section B question was really weird. I put it square rooted an input and when inputting 4.1 I got like 2.0499999. Thought I'd mucked up but seems other people got the same :')
    Offline

    0
    ReputationRep:
    (Original post by uGo1001)
    Does anyone have the code for the last question? I think I was close but I couldn't get it to work
    This was my solution:
    Name:  CheckIfFlips.png
Views: 133
Size:  68.3 KB
    Then just called it in PlayGame()
    Offline

    2
    ReputationRep:
    Code for last question in VB:

    Name:  VB.png
Views: 105
Size:  6.0 KB

    (the if loop just repeats 4 times with either 1,0 -1,0 0,1 0,-1 at the end of each call)
    Offline

    2
    ReputationRep:
    Is there a COMP2 thread?
    Offline

    11
    ReputationRep:
    (Original post by Teee123)
    Is there a COMP2 thread?
    just started one here:

    http://www.thestudentroom.co.uk/show...1#post65518611
 
 
 
Poll
Do you agree with the PM's proposal to cut tuition fees for some courses?

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.