The Student Room Group

AQA AS Computing Skeleton Code 2014

Scroll to see replies

Hi Guys.

Not sure if this has been uploaded before but I found this excel spreadsheet. If anyone is struggling with Hamming Code take a look.

Seemed useful to me(and of course the AQA AS book) :smile:

Have fun!

https://dl.dropboxusercontent.com/u/95807728/hamming%20code.xls
Original post by BlackLipBastard
Haha same, I keep starting off adding the probability sub first so that it makes it more fun :P


How have you programmed the probabilities? i made an array of probabilities at the start of the game that i increase or decrease depending on the cards drawn..What about you?
Original post by BlackLipBastard
Are you sure about 51 ? I replaced all the 52 but it seemed to work fine, what happens when you replace all the 51 as well?


From my understanding you need to replace that because it's under the assumption the deck is 52 cards large. However it isn't there are 13 extra cards that aren't accounted for. Therefore if you don't replace a 51 it would be operating under the assumption the deck is 52 cards big.
So whatever said function does will only work up to the 52nd card in which then it will break.

For instance when updating recent scores if you get to the end of a deck and gameover never = true it passes 51 as a score. Saying you got a score of 51, when you would actually have a higher score since the deck is larger.

A more crucial example:

Sub GetCard(ByRef ThisCard As TCard, ByRef Deck() As TCard, ByVal NoOfCardsTurnedOver As Integer)
Dim Count As Integer
ThisCard = Deck(1)
For Count = 1 To (51 - NoOfCardsTurnedOver)
Deck(Count) = Deck(Count + 1)
Next
Deck(52 - NoOfCardsTurnedOver).Suit = 0
Deck(52 - NoOfCardsTurnedOver).Rank = 0

End Sub

This function would only get cards up to the 52nd position, setting cards after that equal to zero rank and zero suit.
Original post by AdilMalikN
How have you programmed the probabilities? i made an array of probabilities at the start of the game that i increase or decrease depending on the cards drawn..What about you?

I made a separate procedure, then in that procedure I calculated the percentage of the next card being higher and then call the procedure in the PlayGame procedure
Original post by dominicwild
From my understanding you need to replace that because it's under the assumption the deck is 52 cards large. However it isn't there are 13 extra cards that aren't accounted for. Therefore if you don't replace a 51 it would be operating under the assumption the deck is 52 cards big.
So whatever said function does will only work up to the 52nd card in which then it will break.

For instance when updating recent scores if you get to the end of a deck and gameover never = true it passes 51 as a score. Saying you got a score of 51, when you would actually have a higher score since the deck is larger.

A more crucial example:

Sub GetCard(ByRef ThisCard As TCard, ByRef Deck() As TCard, ByVal NoOfCardsTurnedOver As Integer)
Dim Count As Integer
ThisCard = Deck(1)
For Count = 1 To (51 - NoOfCardsTurnedOver)
Deck(Count) = Deck(Count + 1)
Next
Deck(52 - NoOfCardsTurnedOver).Suit = 0
Deck(52 - NoOfCardsTurnedOver).Rank = 0

End Sub

This function would only get cards up to the 52nd position, setting cards after that equal to zero rank and zero suit.

Oh cool I know what you mean
Original post by donutellme
Yep, I'm using VB. So the deck is shuffled. Now what you do is you write each part to a text file using streamwriter, line by line, and then you can use the existing LoadDeck function to load it back.

Aww I'm so confused, do you have the code
can someone post the actual skeleton programs for the following : 2014, 13, 12, 11
Original post by BlackLipBastard
Aww I'm so confused, do you have the code


Here you go :smile:

Why is every one doing visualbasics, my class started doing that then our teacher told us java is better so we have been using java ever since but its harder so any one here doing java language for comp1?
bloody hell i just realised every other schools might have received the Electronic Answer Document, my teacher is fking damn we didn't get it. its all his fault if we fail fking hell.
Anyone know where to find 2012 and 2013 Skeleton code? Preferably pascal but it doesn't matter

Posted from TSR Mobile
Original post by donutellme
Here you go :smile:



Any reason as to why your are using a text file? wouldn't it me much easier to write the whole Array of Deck to a binary file? then read it as it was?
Original post by Brave reader
Why is every one doing visualbasics, my class started doing that then our teacher told us java is better so we have been using java ever since but its harder so any one here doing java language for comp1?


VB is much easier in the sense its for dummies. If you do a mistake it literally tells you how to fix it. Cant go wrong with that if you know what your doing...
Original post by Brave reader
bloody hell i just realised every other schools might have received the Electronic Answer Document, my teacher is fking damn we didn't get it. its all his fault if we fail fking hell.

The EAD was available from the same place as the skeleton program. You don't actually need it before the exam.
When you turn up for the exam tomorrow, the EAD and a new version of the skeleton program should be set up for you with a new secure network account.
Original post by HugeBicepLAD
Anyone know where to find 2012 and 2013 Skeleton code? Preferably pascal but it doesn't matter

Posted from TSR Mobile

They are completely different programs so I'm not sure how they will help.
Have u got it and how does it look like can u take screen print of it. Thanks
hey guys I'm having some trouble with the probability function:s-smilie: it outputs 0% after each session and I dont know why...
Heres my procedure for it
void SetPercentAge(TCard[] deck, TCard lastCard){
int percentage=(13-lastCard.rank)/13*100;
console.println("Chance of next card being higher = "+percentage+"%");
}

I call it just below the getCard method within the while loop in the play game procedure

while (noOfCardsTurnedOver < 52 && !gameOver) {
getCard(nextCard, deck, noOfCardsTurnedOver);
SetPercentge(deck,lastCard)
}
(edited 9 years ago)
Reply 197
EAD has a table of some sort iirc? I think it may be a truth table.

Also, are issues such as these good to revise:

Loading / Saving from file
If same card rank, judges by suit
Altering top scores, so only shows if scores are present

Anymore that you would recommend going over a few more times?
Question: "Allow user to save the whole game, including the current player pack and the recent scores, quit the program, then restart program and continue to play saved game/scores."
Is such a question possible or too advanced/unlikely?
Original post by Dinvan
EAD has a table of some sort iirc? I think it may be a truth table.

Also, are issues such as these good to revise:

Loading / Saving from file
If same card rank, judges by suit
Altering top scores, so only shows if scores are present

Anymore that you would recommend going over a few more times?


Ranking recent scores is pretty essential too, I think that will come up, its really easy once u get the hang of it and I'm pretty sure its gonna be a worth a nifty amount of marks :biggrin::biggrin:
(edited 9 years ago)

Quick Reply

Latest

Trending

Trending