Turn on thread page Beta
 You are Here: Home

# *megathread* computer science pre release 2016 predicitons watch

1. Hey all , This is just a thread for all the questions/predictions for tommorows pre release.

Lets all work together!!!!
2. (Original post by compscistudent1)
Hey all , This is just a thread for all the questions/predictions for tommorows pre release.

Lets all work together!!!!
I've moved this to the Computer Science forum for you
3. Is this for AQA?
4. you won't get any predictions here because barely anyone studies AL Computer Science
5. (Original post by GarlicBread01)
Is this for AQA?
Yes it is
6. Well we only received the skeleton code recently so I dont have that much input yet.

Im guessing over the days more people will come to have ideas.
7. I have the Python skeleton code if anyone is taking the exam in Python (I've written it the way AQA have provided it) (: Also just thought it's worth mentioning now, that the program crashes when you enter coordinates too large for the grid - so they may possibly ask for a validation to correct this?
Code:
```#Skeleton Program for the AQA AS1 Summer 2016 examination
#this code should be used in conjunction with the Preliminary Material
#written by the AQA AS1 Programmer Team
#developed in a Python 3 programming environment

#Version Number 1.0

import random

def GetRowColumn():
print()
Column = int(input("Please enter column: "))
Row = int(input("Please enter row: "))
print()
return Row, Column

def MakePlayerMove(Board, Ships):
Row, Column = GetRowColumn()
if Board[Row][Column] == "m" or Board[Row][Column] == "h":
print("Sorry, you have already shot at the square (" + str(Column) + "," + str(Row) + "). Please try again.")
elif Board[Row][Column] == "-":
print("Sorry, (" + str(Column) + "," + str(Row) + ") is a miss.")
Board[Row][Column] = "m"
else:
print("Hit at (" + str(Column) + "," + str(Row) + ").")
Board[Row][Column] = "h"

def SetUpBoard():
Board = []
for Row in range(10):
BoardRow = []
for Column in range(10):
BoardRow.append("-")
Board.append(BoardRow)
return Board

BoardFile = open(Filename, "r")
for Row in range(10):
for Column in range(10):
Board[Row][Column] = Line[Column]
BoardFile.close()

def PlaceRandomShips(Board, Ships):
for Ship in Ships:
Valid = False
while not Valid:
Row = random.randint(0, 9)
Column = random.randint(0, 9)
HorV = random.randint(0, 1)
if HorV == 0:
Orientation = "v"
else:
Orientation = "h"
Valid = ValidateBoatPosition(Board, Ship, Row, Column, Orientation)                 print("Computer placing the " + Ship[0])
PlaceShip(Board, Ship, Row, Column, Orientation)

def PlaceShip(Board, Ship, Row, Column, Orientation):
if Orientation == "v":
for Scan in range(Ship[1]):
Board[Row + Scan][Column] = Ship[0][0]
elif Orientation == "h":
for Scan in range(Ship[1]):
Board[Row][Column + Scan] = Ship[0][0]

def ValidateBoatPosition(Board, Ship, Row, Column, Orientation):
if Orientation == "v" and Row + Ship[1] > 10:
return False
elif Orientation == "h" and Column + Ship[1] > 10:
return False
else:
if Orientation == "v":
for Scan in range(Ship[1]):
if Board[Row + Scan][Column] != "-":
return False
elif Orientation == "h":
for Scan in range(Ship[1]):
if Board[Row][Column + Scan] != "-":
return False
return True

def CheckWin(Board):
for Row in range(10):
for Column in range(10):
if Board[Row][Column] in ["A","B","S","D","P"]:
return False
return True

def PrintBoard(Board):
print()
print("The board looks like this: ")
print()
print (" ", end="")
for Column in range(10):
print(" " + str(Column) + "  ", end="")
print()
for Row in range(10):
print (str(Row) + " ", end="")
for Column in range(10):
if Board[Row][Column] == "-":
print(" ", end="")
elif Board[Row][Column] in ["A","B","S","D","P"]:
print(" ", end="")
else:
print(Board[Row][Column], end="")
if Column != 9:
print(" | ", end="")
print()

print()  print("1. Start new game")
print("2. Load training game")
print("9. Quit")
print()

Choice = int(input())
print()
return Choice

def PlayGame(Board, Ships):
GameWon = False
while not GameWon:
PrintBoard(Board)
MakePlayerMove(Board, Ships)
GameWon = CheckWin(Board)
if GameWon:
print("All ships sunk!")
print()

if __name__ == "__main__":
TRAININGGAME = "Training.txt"
while not MenuOption == 9:
Board = SetUpBoard()
Ships = [["Aircraft Carrier", 5], ["Battleship", 4], ["Submarine", 3], ["Destroyer", 3], ["Patrol Boat", 2]]
if MenuOption == 1:
PlaceRandomShips(Board, Ships)
PlayGame(Board,Ships)
if MenuOption == 2:
PlayGame(Board, Ships)```
8. klm
9. Is the code provided being used for the new AQA AS Level computer science course?

If so, I'm studying this course but my teacher hasn't provided us with any of the material yet, or let us know that it's available

I'll also be programming in Python for the exam
10. (Original post by AmarRPM)
Is the code provided being used for the new AQA AS Level computer science course?

If so, I'm studying this course but my teacher hasn't provided us with any of the material yet.. or even let us known that it's available

I'll also be programming in Python for the exam
The code is for the new AQA A level Computer Science, I'm also doing it in Python! But the rest of my class are doing it in PASCAL lol.
11. (Original post by walkinglamb)
The code is for the new AQA A level Computer Science, I'm also doing it in Python! But the rest of my class are doing it in PASCAL lol.
Oh wow, it's good that someone attached the code in here then, as my teacher hasn't provided the material to my class yet.

I'll definitely be sure to play around with the code a bit and familiarise myself with it. Should make the exam much easier!
12. (Original post by Little Old Lady)
I have the Python skeleton code if anyone is taking the exam in Python (I've written it the way AQA have provided it) (: Also just thought it's worth mentioning now, that the program crashes when you enter coordinates too large for the grid - so they may possibly ask for a validation to correct this?
Code:
```#Skeleton Program for the AQA AS1 Summer 2016 examination
#this code should be used in conjunction with the Preliminary Material
#written by the AQA AS1 Programmer Team
#developed in a Python 3 programming environment

#Version Number 1.0

import random

def GetRowColumn():
print()
Column = int(input("Please enter column: ";))
Row = int(input("Please enter row: ";))
print()
return Row, Column

def MakePlayerMove(Board, Ships):
Row, Column = GetRowColumn()
if Board[Row][Column] == "m" or Board[Row][Column] == "h":
print("Sorry, you have already shot at the square (" + str(Column) + "," + str(Row) + ";). Please try again.";)
elif Board[Row][Column] == "-":
print("Sorry, (" + str(Column) + "," + str(Row) + ";) is a miss.";)
Board[Row][Column] = "m"
else:
print("Hit at (" + str(Column) + "," + str(Row) + ";).";)
Board[Row][Column] = "h"

def SetUpBoard():
Board = []
for Row in range(10):
BoardRow = []
for Column in range(10):
BoardRow.append("-";)
Board.append(BoardRow)
return Board

BoardFile = open(Filename, "r";)
for Row in range(10):
for Column in range(10):
Board[Row][Column] = Line[Column]
BoardFile.close()

def PlaceRandomShips(Board, Ships):
for Ship in Ships:
Valid = False
while not Valid:
Row = random.randint(0, 9)
Column = random.randint(0, 9)
HorV = random.randint(0, 1)
if HorV == 0:
Orientation = "v"
else:
Orientation = "h"
Valid = ValidateBoatPosition(Board, Ship, Row, Column, Orientation)                 print("Computer placing the " + Ship[0])
PlaceShip(Board, Ship, Row, Column, Orientation)

def PlaceShip(Board, Ship, Row, Column, Orientation):
if Orientation == "v":
for Scan in range(Ship[1]):
Board[Row + Scan][Column] = Ship[0][0]
elif Orientation == "h":
for Scan in range(Ship[1]):
Board[Row][Column + Scan] = Ship[0][0]

def ValidateBoatPosition(Board, Ship, Row, Column, Orientation):
if Orientation == "v" and Row + Ship[1] > 10:
return False
elif Orientation == "h" and Column + Ship[1] > 10:
return False
else:
if Orientation == "v":
for Scan in range(Ship[1]):
if Board[Row + Scan][Column] != "-":
return False
elif Orientation == "h":
for Scan in range(Ship[1]):
if Board[Row][Column + Scan] != "-":
return False
return True

def CheckWin(Board):
for Row in range(10):
for Column in range(10):
if Board[Row][Column] in ["A","B","S","D","P"]:
return False
return True

def PrintBoard(Board):
print()
print("The board looks like this: ";)
print()
print (" ", end="";)
for Column in range(10):
print(" " + str(Column) + "  ", end="";)
print()
for Row in range(10):
print (str(Row) + " ", end="";)
for Column in range(10):
if Board[Row][Column] == "-":
print(" ", end="";)
elif Board[Row][Column] in ["A","B","S","D","P"]:
print(" ", end="";)
else:
print(Board[Row][Column], end="";)
if Column != 9:
print(" | ", end="";)
print()

print()  print("1. Start new game";)
print("2. Load training game";)
print("9. Quit";)
print()

Choice = int(input())
print()
return Choice

def PlayGame(Board, Ships):
GameWon = False
while not GameWon:
PrintBoard(Board)
MakePlayerMove(Board, Ships)
GameWon = CheckWin(Board)
if GameWon:
print("All ships sunk!";)
print()

if __name__ == "__main__":
TRAININGGAME = "Training.txt"
while not MenuOption == 9:
Board = SetUpBoard()
Ships = [["Aircraft Carrier", 5], ["Battleship", 4], ["Submarine", 3], ["Destroyer", 3], ["Patrol Boat", 2]]
if MenuOption == 1:
PlaceRandomShips(Board, Ships)
PlayGame(Board,Ships)
if MenuOption == 2:
PlayGame(Board, Ships)```
Thanks a bunch for attaching this, it's helped me a lot!
13. Since no one started contributing as of yet, i'll input what me and my class thought could be asked us:
- Validation for every input (obvious one)
- Difficulty levels - change how long each ship is.
- Make the program tell you when each individual ship has been sunk
- Score system
- Add a new ship

As far as I am aware there is no other obvious parts of the code that could be used for anything else, and it is unlikely that they ask us to write our own code (they usually don't do it, altough it could happen), so I am quite lost as to what they could ask. Any ideas?

By the way, I am also doing Python.
14. jikjml
15. Bump.
16. (Original post by gomc)
can someone send me the Training.txt file?
Sorry completely forgot to include it with the Python Skeleton Code! Here you go (:
Attached Files
17. Training.txt (110 Bytes, 155 views)
18. i can't use the training game part of the menu that involves the training text file and its stressing me out!! it comes up with an error
19. So ive left my revision abit late as per xD

Could anyone supply me with some solutions for the predicted questions? Would really help me!!.

P.S I am doing it in python also.
20. Can anyone upload the prerelease in VB.net? Would be much appreciated, can't seem to find it and my school's remote desktop connection isn't working.
21. (Original post by JonoSwanno)
So ive left my revision abit late as per xD

Could anyone supply me with some solutions for the predicted questions? Would really help me!!.

P.S I am doing it in python also.
This might help https://en.wikibooks.org/wiki/A-leve...er1_this_year)

Turn on thread page Beta

### Related university courses

TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: June 6, 2016
The home of Results and Clearing

### 2,459

people online now

### 1,567,000

students helped last year
Today on TSR

### University open days

1. Keele University
General Open Day Undergraduate
Sun, 19 Aug '18
2. University of Melbourne
Sun, 19 Aug '18
3. Sheffield Hallam University
Tue, 21 Aug '18
Poll
Useful resources

## Make your revision easier

Can you help? Study Help unanswered threadsStudy Help rules and posting guidelines

## Groups associated with this forum:

View associated groups

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