Turn on thread page Beta
    Offline

    2
    ReputationRep:
    Has anyone got any idea what will be in section A & B, other than pseudo code and state transition diagrams? I've got the book and look at the past exam questions but they just seem to ask you about how you'd go about fixing things and stuff like nesting and arrays...............
    • Thread Starter
    Offline

    2
    ReputationRep:
    (Original post by Jixum)
    The skeleton program allows the player to place their piece anywhere on the board, when in a real game, you can only place a piece if doing so actually TAKES an opponents piece. This is a core part of the game, so I imagine that this is quite likely to come up but I can't find a solution yet.
    I solved it I was being an idiot and it tuned out to be simpler than i thought.
    If anyone is stuck on this one let me know and I'll walk you through it
    Offline

    1
    ReputationRep:
    (Original post by aelahi23)
    I solved it I was being an idiot and it tuned out to be simpler than i thought.
    If anyone is stuck on this one let me know and I'll walk you through it
    Hey i'm doing the comp1 exam as well but in vb.net. Mind explaining how you solved it please?
    Offline

    2
    ReputationRep:
    (Original post by Hassan Hassan)
    Hey i'm doing the comp1 exam as well but in vb.net. Mind explaining how you solved it please?
    Are you able to pm me the vb.net source code?
    • Thread Starter
    Offline

    2
    ReputationRep:
    (Original post by Hassan Hassan)
    Hey i'm doing the comp1 exam as well but in vb.net. Mind explaining how you solved it please?
    I sent you the solution check your inbox
    Offline

    0
    ReputationRep:
    (Original post by aelahi23)
    I sent you the solution check your inbox
    can you send me the solution as well please?
    • Thread Starter
    Offline

    2
    ReputationRep:
    (Original post by anwar abdi)
    can you send me the solution as well please?
    I've PM'd you the solution
    Offline

    2
    ReputationRep:
    bn
    Offline

    2
    ReputationRep:
    (Original post by aelahi23)
    I've PM'd you the solution
    What language are you using? Would you be able to pm me the solution as well please
    • Thread Starter
    Offline

    2
    ReputationRep:
    (Original post by ItsIzzy)
    What language are you using? Would you be able to pm me the solution as well please
    due to so many requests I'll post the solution here

    Step 1) there should be a a function called CheckIfMoveIsValid, what you need to do is modify the if statement to this

    If Board[Row, Column] = '"empty space" and(CheckIfThereArePiecesToFlip(Boar d, BoardSize, Row, Column, 1,0 = true
    or CheckIfThereArePiecesToFlip(Boar d, BoardSize, Row, Column, -1, 0) = true
    or CheckIfThereArePiecesToFlip(Boar d, BoardSize, Row, Column, 0, 1) = true
    or CheckIfThereArePiecesToFlip(Boar d, BoardSize, Row, Column, 0, -1) = true)
    Then MoveIsValid <== True
    what this does is call the function to check if there are pieces to flip and the function will return true or false and if it returns true

    Step 2) Make HumanPlayerTurn a global variable instead of a local variable in the PlayGame Function

    Step 3)Then paste the following if statement in the function called CheckIfThereArePiecesToFlip right at the start of the function
    If HumanPlayersTurn = true
    Then Board[StartRow, StartColumn] := 'H'
    Else Board[StartRow, StartColumn] := 'C'

    when the function to check for flips is called it's called after the letter has been assigned to the game board cells so the flip function doesn't see an empty space but a letter in the place you entered the coordinates for, since we are calling it earlier before the letter gets assigned to the board the function still reads it as an empty space and will not work thats why in step 3 you have to add and if statement to temporarily assign the selected coordinate to hold a letter

    if you still don't get it let me know

    I have done every other possible problems we discussed on the first page of this thread and have solved them so if anyone is stuck just leave a message here. If I don't do the same language as you I can still provide a working algorithm to solve a problem
    Offline

    2
    ReputationRep:
    (Original post by aelahi23)
    due to so many requests I'll post the solution here

    Step 1) there should be a a function called CheckIfMoveIsValid, what you need to do is modify the if statement to this

    If Board[Row, Column] = '"empty space" and(CheckIfThereArePiecesToFlip(Boar d, BoardSize, Row, Column, 1,0 = true
    or CheckIfThereArePiecesToFlip(Boar d, BoardSize, Row, Column, -1, 0) = true
    or CheckIfThereArePiecesToFlip(Boar d, BoardSize, Row, Column, 0, 1) = true
    or CheckIfThereArePiecesToFlip(Boar d, BoardSize, Row, Column, 0, -1) = true)
    Then MoveIsValid <== True
    what this does is call the function to check if there are pieces to flip and the function will return true or false and if it returns true

    Step 2) Make HumanPlayerTurn a global variable instead of a local variable in the PlayGame Function

    Step 3)Then paste the following if statement in the function called CheckIfThereArePiecesToFlip right at the start of the function
    If HumanPlayersTurn = true
    Then Board[StartRow, StartColumn] := 'H'
    Else Board[StartRow, StartColumn] := 'C'

    when the function to check for flips is called it's called after the letter has been assigned to the game board cells so the flip function doesn't see an empty space but a letter in the place you entered the coordinates for, since we are calling it earlier before the letter gets assigned to the board the function still reads it as an empty space and will not work thats why in step 3 you have to add and if statement to temporarily assign the selected coordinate to hold a letter

    if you still don't get it let me know

    I have done every other possible problems we discussed on the first page of this thread and have solved them so if anyone is stuck just leave a message here. If I don't do the same language as you I can still provide a working algorithm to solve a problem
    How about do everyone a HUGE favour and write the algorithms for every problem and post it?
    • Thread Starter
    Offline

    2
    ReputationRep:
    (Original post by Filipo)
    How about do everyone a HUGE favour and write the algorithms for every problem and post it?
    Do you know how long that would take, I'd rather help with the few difficult ones that people request than write up algorithms for every question even the basic one
    Offline

    1
    ReputationRep:
    Do you know how to allow diagonal flipping of pieces in VB Please
    Offline

    0
    ReputationRep:
    (Original post by rockingmax)
    Do you know how to allow diagonal flipping of pieces in VB Please
    FlipOpponentPiecesInOneDirection (Board, BoardSize, Row, Column, 1, 1) FlipOpponentPiecesInOneDirection (Board, BoardSize, Row, Column, -1, 1) FlipOpponentPiecesInOneDirection (Board, BoardSize, Row, Column, -1, 1) FlipOpponentPiecesInOneDirection (Board, BoardSize, Row, Column, 1, -1)
    try this, under the make move subroutine and it should hopefully work
    Offline

    2
    ReputationRep:
    (Original post by anwar abdi)
    FlipOpponentPiecesInOneDirection (Board, BoardSize, Row, Column, 1, 1) FlipOpponentPiecesInOneDirection (Board, BoardSize, Row, Column, -1, 1) FlipOpponentPiecesInOneDirection (Board, BoardSize, Row, Column, -1, 1) FlipOpponentPiecesInOneDirection (Board, BoardSize, Row, Column, 1, -1)
    try this, under the make move subroutine and it should hopefully work
    Is this for the resit or the AS battleships , If it is for the AS , what is meant by flipping?
    Offline

    2
    ReputationRep:
    (Original post by marioman)
    This is unlikely, as there is no way of testing this reliably in the exam due to the computer choosing its moves at random.

    I think they may ask something to do with counting the number of pieces of each type on the board, for example calculating the percentage of 'Human' pieces on the board compared to 'Computer' pieces.
    If anyone want's a solution to the percentage score of each of the two players, pm me and I will give you the solution
    • Thread Starter
    Offline

    2
    ReputationRep:
    (Original post by ChuckyTownXL)
    Is this for the resit or the AS battleships , If it is for the AS , what is meant by flipping?
    Flip:
    1. 1) turn over or cause to turn over with a sudden quick movement."the plane flipped over and then exploded"
    2. 2) move, push, or throw (something) with a sudden quick movement."she flipped off her dark glasses"
    Offline

    3
    ReputationRep:
    (Original post by ChuckyTownXL)
    Is this for the resit or the AS battleships , If it is for the AS , what is meant by flipping?
    If you bothered reading the thread title you would see that this is the for COMP1 resit paper.
    Offline

    1
    ReputationRep:
    (Original post by anwar abdi)
    FlipOpponentPiecesInOneDirection (Board, BoardSize, Row, Column, 1, 1) FlipOpponentPiecesInOneDirection (Board, BoardSize, Row, Column, -1, 1) FlipOpponentPiecesInOneDirection (Board, BoardSize, Row, Column, -1, 1) FlipOpponentPiecesInOneDirection (Board, BoardSize, Row, Column, 1, -1)
    try this, under the make move subroutine and it should hopefully work
    Thanks :nyan:
    Offline

    2
    ReputationRep:
    Title is comp 2 2016 but thanks anyway 👍🏼
 
 
 
Reply
Submit reply
Turn on thread page Beta
Updated: August 19, 2016
Poll
Is the Big Bang theory correct?

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.