The Student Room Group

is anyone doing the AQA computing science, greenfly scenario?(4512/cb4)

I am stuck on how to run the model, i don't know the bit of coding necessary to display the different generations depending on the numbers inputted by the user.
Original post by akirne39
I am stuck on how to run the model, i don't know the bit of coding necessary to display the different generations depending on the numbers inputted by the user.


I'll try to include that bit when I send you a pm later. Sorry I haven't replied before, everything is on my laptop which I haven't been able to get on for a couple of days
Reply 2
did you manage to find out how to do it? I'm stuck on the same thing.
Original post by J565
did you manage to find out how to do it? I'm stuck on the same thing.


You'll need a variable which stores the number which the user inputs then have a loop which loops that number of times doing the calculations each time
Reply 4
im stuck on how to move the player in treasure hunt game


(plz dnt send any coding lol cos i dnt want to be banned from my exams)

but abrief explanation would be ncie
Original post by Chez 01
im stuck on how to move the player in treasure hunt game


(plz dnt send any coding lol cos i dnt want to be banned from my exams)

but abrief explanation would be ncie


What tools are you using (as in data grid view etc.)
What platform/ language? (Visual Studio/ Visual basic etc.)
Our code isn't allowed out of school so I couldn't have sent it even if I wanted to lol

Posted from TSR Mobile
Reply 6
Original post by Lemur14
What tools are you using (as in data grid view etc.)
What platform/ language? (Visual Studio/ Visual basic etc.)
Our code isn't allowed out of school so I couldn't have sent it even if I wanted to lol

Posted from TSR Mobile


lol and thnx for the quick reply

i am using a picturebox for my grid and i am using visual studio express
Original post by Chez 01
lol and thnx for the quick reply

i am using a picturebox for my grid and i am using visual studio express


Sorry, lots of questions, just trying to get an idea of how you have yours working.
One picture box or many?
And do you have a way of linking them together (if many)?

I haven't seen anyone use pictureboxes for it, but I used a table layout panel, which can be matched with a 2D array and each of the squares can have their content changed to X if the player chooses to land there.
So I have a variable storing the current player position, then when the player enters in their move I have another variable which adds the 2 together and finds if the position is within the grid. If it is the player position is set to this new value and the X I have showing the player position is moved to this new place.
This method is quite complicated though and most my classmates took the simpler option of putting 2 data grid views on top of each other.

Could you explain how you got your chests and bandits to be randomised?

(Sorry probably not much help yet!)

Posted from TSR Mobile
Reply 8
Original post by Lemur14
Sorry, lots of questions, just trying to get an idea of how you have yours working.
One picture box or many?
And do you have a way of linking them together (if many)?

I haven't seen anyone use pictureboxes for it, but I used a table layout panel, which can be matched with a 2D array and each of the squares can have their content changed to X if the player chooses to land there.
So I have a variable storing the current player position, then when the player enters in their move I have another variable which adds the 2 together and finds if the position is within the grid. If it is the player position is set to this new value and the X I have showing the player position is moved to this new place.
This method is quite complicated though and most my classmates took the simpler option of putting 2 data grid views on top of each other.

Could you explain how you got your chests and bandits to be randomised?

(Sorry probably not much help yet!)

Posted from TSR Mobile


no i just basically declared my gridcells as (8,8) picturebox
so its 1 picturebox with (8,8) cells in in and im referring to my cells as gridbox in my program

ive used a radio button and the player gets to choose up or down and left or right thenthey can input how many steps they want to mve vertically and horizontally and

ive decalred my player location as x and y cos i know my coordinates for my grid and i coded -1 to move up and right +1 to move left and down
idk i think ive worded to make it sund comlicated i think its similar to wot u sed
Original post by Chez 01
no i just basically declared my gridcells as (8,8) picturebox
so its 1 picturebox with (8,8) cells in in and im referring to my cells as gridbox in my program

ive used a radio button and the player gets to choose up or down and left or right thenthey can input how many steps they want to mve vertically and horizontally and

ive decalred my player location as x and y cos i know my coordinates for my grid and i coded -1 to move up and right +1 to move left and down
idk i think ive worded to make it sund comlicated i think its similar to wot u sed


Yeah that does sounds quite similar to mine :smile: So if you said Gridcells(3,2) your program would know which cell that was?
If so, you'll basically want to add the values of your current position and how far the user wants to move together. Then test if this is in the grid.
If it is in the grid then you can put Gridcells(UserXCoord, UserYCoord) = "X" (Well not quite that as that isn't how you refer to a picture box, but I can't remember how to do that, so hopefully you get the idea)
Then you test it against however your chests and bandits are called and act accordingly
Test if the user has won. Act accordingly.
Then repeat when the user enters in a new move

Hope that makes sense :smile:

Posted from TSR Mobile
Original post by Lemur14
Yeah that does sounds quite similar to mine :smile: So if you said Gridcells(3,2) your program would know which cell that was?
If so, you'll basically want to add the values of your current position and how far the user wants to move together. Then test if this is in the grid.
If it is in the grid then you can put Gridcells(UserXCoord, UserYCoord) = "X" (Well not quite that as that isn't how you refer to a picture box, but I can't remember how to do that, so hopefully you get the idea)
Then you test it against however your chests and bandits are called and act accordingly
Test if the user has won. Act accordingly.
Then repeat when the user enters in a new move

Hope that makes sense :smile:

Posted from TSR Mobile


yes if i called the cell (3,2) my progra would know what it is

basically i didnt quite understand what u explained there

but i used the x and y coordinates in mycding to move the player but when i run the program instead of moving the player the player dissappears from the grid

hope that makes sense
Original post by Chez 01
yes if i called the cell (3,2) my progra would know what it is

basically i didnt quite understand what u explained there

but i used the x and y coordinates in mycding to move the player but when i run the program instead of moving the player the player dissappears from the grid

hope that makes sense


oh yeah and you asked how i got my bandits and chests randomised (sorry i didnt see your question b4)

basically to randomize them i used a do until loop and if statement inside the loop
Original post by Chez 01
yes if i called the cell (3,2) my progra would know what it is

basically i didnt quite understand what u explained there

but i used the x and y coordinates in mycding to move the player but when i run the program instead of moving the player the player dissappears from the grid

hope that makes sense


How is the player programmed to move? (As in, does it add text to the cell, or move a label around etc.)

Posted from TSR Mobile
Original post by Chez 01
oh yeah and you asked how i got my bandits and chests randomised (sorry i didnt see your question b4)

basically to randomize them i used a do until loop and if statement inside the loop


Don't worry :smile: You basically answered my question when talking about how your program responds anyway :smile:

Posted from TSR Mobile

Quick Reply

Latest