The Student Room Group

Aqa comp1 2016

Scroll to see replies

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...............
Reply 21
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
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?
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?
Reply 24
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
Original post by aelahi23
I sent you the solution check your inbox


can you send me the solution as well please?
Reply 26
Original post by anwar abdi
can you send me the solution as well please?


I've PM'd you the solution
bn
Reply 28
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 :smile:
(edited 7 years ago)
Reply 29
Original post by ItsIzzy
What language are you using? Would you be able to pm me the solution as well please :smile:


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
Reply 30
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? :biggrin:
Reply 31
Original post by Filipo
How about do everyone a HUGE favour and write the algorithms for every problem and post it? :biggrin:


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
Do you know how to allow diagonal flipping of pieces in VB Please :smile:
Original post by rockingmax
Do you know how to allow diagonal flipping of pieces in VB Please :smile:


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:smile:
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:smile:


Is this for the resit or the AS battleships , If it is for the AS , what is meant by flipping? :biggrin:
Reply 35
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 :smile:
Reply 36
Original post by ChuckyTownXL
Is this for the resit or the AS battleships , If it is for the AS , what is meant by flipping? :biggrin:


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"

Original post by ChuckyTownXL
Is this for the resit or the AS battleships , If it is for the AS , what is meant by flipping? :biggrin:


If you bothered reading the thread title you would see that this is the for COMP1 resit paper.
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:smile:


Thanks :nyan:
Title is comp 2 2016 but thanks anyway 👍🏼

Quick Reply

Latest

Trending

Trending