The Student Room Group

AQA A Level computer science Skeleton code 2024

Anyone got any explanation of the code or errors as I am lost, my teacher has just made us learn it on our own

Scroll to see replies

Original post by mistj
Anyone got any explanation of the code or errors as I am lost, my teacher has just made us learn it on our own

Honestly, most of the code is quite simple once you take the time to go through it slowly(it will take some time but it is worth it, I was also super confused at the start), I usually go line by line, and if there is something I don't understand I skip it and try to get onto it at the end. That being said there is a section of the code that completely mind-boggles me, the section I am talking about is below(I just don't understand how the patterns are made):
self.__AllowedPatterns = []
self.__AllowedSymbols = []
QPattern = Pattern("Q", "QQ*Q*QQ") -----> how does this make the Q pattern
self.__AllowedPatterns.append(QPattern)
self.__AllowedSymbols.append("Q")
XPattern = Pattern("X", "X *X *X *X *X") ----> how does this make the x pattern
self.__AllowedPatterns.append(XPattern)
self.__AllowedSymbols.append("X")
TPattern = Pattern("T", "TTT*T*T") ---> how does this make the T pattern
self.__AllowedPatterns.append(TPattern)
self.__AllowedSymbols.append("T")
Reply 2
3 Bits that they will likely ask questions on are -

Verifying Filename Input

Adding a new Pattern and symbol

Filling out UpdateCell

(Update cell is just a Pass definition)


Loads more to do with it, we're currently doing a save function in my class - but those 3 are the most likely Imo to show up, and Figuring them out will get you to figure everything else out
Reply 3
Original post by random123786
Honestly, most of the code is quite simple once you take the time to go through it slowly(it will take some time but it is worth it, I was also super confused at the start), I usually go line by line, and if there is something I don't understand I skip it and try to get onto it at the end. That being said there is a section of the code that completely mind-boggles me, the section I am talking about is below(I just don't understand how the patterns are made):
self.__AllowedPatterns = []
self.__AllowedSymbols = []
QPattern = Pattern("Q", "QQ*Q*QQ") -----> how does this make the Q pattern
self.__AllowedPatterns.append(QPattern)
self.__AllowedSymbols.append("Q")
XPattern = Pattern("X", "X *X *X *X *X") ----> how does this make the x pattern
self.__AllowedPatterns.append(XPattern)
self.__AllowedSymbols.append("X")
TPattern = Pattern("T", "TTT*T*T") ---> how does this make the T pattern
self.__AllowedPatterns.append(TPattern)
self.__AllowedSymbols.append("T")

https://en.wikibooks.org/wiki/A-level_Computing/AQA/Paper_1/Skeleton_program/2024
question 4 should help
Original post by mistj
Anyone got any explanation of the code or errors as I am lost, my teacher has just made us learn it on our own

Hi, Im retaking the exam this year but have no access to the code, can anyone send it to me or let me know where I can find it
Reply 5
does anybody have the zigzag file and send it on here please
Reply 6
Firstly, AQA owns the copyright so you can not upload them to an open forum. See your teacher and they can download a copy for you in the language you need from the AQA portal.

Secondly, the Zigzag materials are also copyrighted. It costs £80ish. I purchase a copy each year and make it available to students at my school each year. I do find them a good resource so do ask your teacher to buy a copy for your school. The wiki site is also a good source (posted by Matthew_Swan above).

As for the question regarding creating symbols by 'random123786'.
On the right are perhaps some other symbols that you might be asked to do in the exam; I went thought the alphabet and these are the only ones that I can get a symbol for in a 3x3 block.

For example C would be entered as

CCC
C * *
CCC

which is CCCC**CCC as a single parameter. So here are the 3 lines of code to add.

TPattern = Pattern("C", "CCCC**CCC")
self.__AllowedPatterns.append(TPattern)
self.__AllowedSymbols.append("C")

Try one of the others from my suggestions above and then test your code.
Reply 7
Original post by random123786
Honestly, most of the code is quite simple once you take the time to go through it slowly(it will take some time but it is worth it, I was also super confused at the start), I usually go line by line, and if there is something I don't understand I skip it and try to get onto it at the end. That being said there is a section of the code that completely mind-boggles me, the section I am talking about is below(I just don't understand how the patterns are made):
self.__AllowedPatterns = []
self.__AllowedSymbols = []
QPattern = Pattern("Q", "QQ*Q*QQ") -----> how does this make the Q pattern
self.__AllowedPatterns.append(QPattern)
self.__AllowedSymbols.append("Q")
XPattern = Pattern("X", "X *X *X *X *X") ----> how does this make the x pattern
self.__AllowedPatterns.append(XPattern)
self.__AllowedSymbols.append("X")
TPattern = Pattern("T", "TTT*T*T") ---> how does this make the T pattern
self.__AllowedPatterns.append(TPattern)
self.__AllowedSymbols.append("T")

The patterns are done in a helix and not line by line. So you start at the top left to top right, then down the right side to bottom right, then left to bottom left, up one square and then into the middle. I can only suggest they have done it this way to make it more complicated.
Reply 8
Original post by reaston
Firstly, AQA owns the copyright so you can not upload them to an open forum. See your teacher and they can download a copy for you in the language you need from the AQA portal.

Secondly, the Zigzag materials are also copyrighted. It costs £80ish. I purchase a copy each year and make it available to students at my school each year. I do find them a good resource so do ask your teacher to buy a copy for your school. The wiki site is also a good source (posted by Matthew_Swan above).

As for the question regarding creating symbols by 'random123786'.
On the right are perhaps some other symbols that you might be asked to do in the exam; I went thought the alphabet and these are the only ones that I can get a symbol for in a 3x3 block.

For example C would be entered as

CCC
C * *
CCC

which is CCCC**CCC as a single parameter. So here are the 3 lines of code to add.

TPattern = Pattern(
Reply 9
Original post by reaston
Firstly, AQA owns the copyright so you can not upload them to an open forum. See your teacher and they can download a copy for you in the language you need from the AQA portal.

Secondly, the Zigzag materials are also copyrighted. It costs £80ish. I purchase a copy each year and make it available to students at my school each year. I do find them a good resource so do ask your teacher to buy a copy for your school. The wiki site is also a good source (posted by Matthew_Swan above).

As for the question regarding creating symbols by 'random123786'.
On the right are perhaps some other symbols that you might be asked to do in the exam; I went thought the alphabet and these are the only ones that I can get a symbol for in a 3x3 block.

For example C would be entered as

CCC
C * *
CCC

which is CCCC**CCC as a single parameter. So here are the 3 lines of code to add.

TPattern = Pattern("C", "CCCC**CCC")
self.__AllowedPatterns.append(TPattern)
self.__AllowedSymbols.append("C")

Try one of the others from my suggestions above and then test your code.

hotpud, well spotted. I cant see a way of editing my post. So lets correct it below:

So a new C symbol:

CCC
C
CCC

stored in the order
123
894
765

would give CCC*CCCC* hence the first line of code need would be:

TPattern = Pattern("C", "CCC*CCCC*")
Reply 10
Original post by reaston
Firstly, AQA owns the copyright so you can not upload them to an open forum. See your teacher and they can download a copy for you in the language you need from the AQA portal.

Secondly, the Zigzag materials are also copyrighted. It costs £80ish. I purchase a copy each year and make it available to students at my school each year. I do find them a good resource so do ask your teacher to buy a copy for your school. The wiki site is also a good source (posted by Matthew_Swan above).

As for the question regarding creating symbols by 'random123786'.
On the right are perhaps some other symbols that you might be asked to do in the exam; I went thought the alphabet and these are the only ones that I can get a symbol for in a 3x3 block.

For example C would be entered as

CCC
C * *
CCC

which is CCCC**CCC as a single parameter. So here are the 3 lines of code to add.

TPattern = Pattern("C", "CCCC**CCC")
self.__AllowedPatterns.append(TPattern)
self.__AllowedSymbols.append("C")

Try one of the others from my suggestions above and then test your code.

For a symbol 'C' the single parameter would be wrote as CCC#CCCC# , no ? I believe the pattern is read in a helix like manner, not Line by Line. Hence why 'Q' is QQ##Q##QQ. Correct me if I am wrong however.
Reply 11
Original post by ellsio
For a symbol 'C' the single parameter would be wrote as CCC#CCCC# , no ? I believe the pattern is read in a helix like manner, not Line by Line. Hence why 'Q' is QQ##Q##QQ. Correct me if I am wrong however.

Both CCC#CCCC# and QQ##Q##QQ that you mentioned are correct.

If you take their positions in the string as 0 1 2 3 4 5 6 7 8, you display them in rows in the order 0 1 2, 7 8 3 and 6 5 4

Visually:

012 QQ#
783 QQ#
654 ##Q
Reply 12
Does anyone have access to the Zigzag A Level AQA Paper 1 2024 Revision Pack for "Symbol Puzzle" from their school? Can you please help me? I can't buy it... can someone please help me?
Reply 13
Original post by random123786
Honestly, most of the code is quite simple once you take the time to go through it slowly(it will take some time but it is worth it, I was also super confused at the start), I usually go line by line, and if there is something I don't understand I skip it and try to get onto it at the end. That being said there is a section of the code that completely mind-boggles me, the section I am talking about is below(I just don't understand how the patterns are made):
self.__AllowedPatterns = []
self.__AllowedSymbols = []
QPattern = Pattern(
Reply 14
[quote="reaston;99032112"]
Original post by reaston
Firstly, AQA owns the copyright so you can not upload them to an open forum. See your teacher and they can download a copy for you in the language you need from the AQA portal.

Secondly, the Zigzag materials are also copyrighted. It costs £80ish. I purchase a copy each year and make it available to students at my school each year. I do find them a good resource so do ask your teacher to buy a copy for your school. The wiki site is also a good source (posted by Matthew_Swan above).

As for the question regarding creating symbols by 'random123786'.
On the right are perhaps some other symbols that you might be asked to do in the exam; I went thought the alphabet and these are the only ones that I can get a symbol for in a 3x3 block.

For example C would be entered as

CCC
C * *
CCC

which is CCCC**CCC as a single parameter. So here are the 3 lines of code to add.

TPattern = Pattern(

Can u please share zigzag education- my school don’t buy it
Original post by random123786
Honestly, most of the code is quite simple once you take the time to go through it slowly(it will take some time but it is worth it, I was also super confused at the start), I usually go line by line, and if there is something I don't understand I skip it and try to get onto it at the end. That being said there is a section of the code that completely mind-boggles me, the section I am talking about is below(I just don't understand how the patterns are made):
self.__AllowedPatterns = []
self.__AllowedSymbols = []
QPattern = Pattern("Q", "QQ*Q*QQ") -----> how does this make the Q pattern
self.__AllowedPatterns.append(QPattern)
self.__AllowedSymbols.append("Q")
XPattern = Pattern("X", "X *X *X *X *X") ----> how does this make the x pattern
self.__AllowedPatterns.append(XPattern)
self.__AllowedSymbols.append("X")
TPattern = Pattern("T", "TTT*T*T") ---> how does this make the T pattern
self.__AllowedPatterns.append(TPattern)
self.__AllowedSymbols.append("T")

The symbols are given in a clockwise order so it'd be like:
1 2 3
8 9 4
7 6 5
which I think is really strange.

So for example, Q ("QQ**Q**QQ") would be
Q Q *
Q Q *
* * Q
ah sorry i hadnt scrolled down far enough, there were already explanations of this.
can anyone do these validation tasks and another task

1.

Ensure that if an invalid filename is entered, the program loads the default 8 x 8 puzzle with random blocked cells, rather than entering an odd state.

2.

Ensure that only symbols which are valid to that game can be entered. Add code to convert any lower case symbol to upper case before checking

3.

Add a save game option into the game. Create a SaveGame subroutine that will be executed if a player chooses to save the game at the end of their turn. They should be prompted for a file name. Ensure the saved file can be reloaded at the start of a new game.

Hey guys what exactly is the difference between puzzle2.txt and puzzle3.txt because they output exactly the same grid; By comparing line by line I found that only the last line had a difference between them but I'm not exactly sure what that changes when the program parses through the text files. If anyone could be of help in understanding this that would be greatly appreciated 😊
Reply 19
Original post by blablabla68
Hey guys what exactly is the difference between puzzle2.txt and puzzle3.txt because they output exactly the same grid; By comparing line by line I found that only the last line had a difference between them but I'm not exactly sure what that changes when the program parses through the text files. If anyone could be of help in understanding this that would be greatly appreciated 😊

The score and number of available symbols to be used r different

Quick Reply