I have an assignment due in shortly, there are 2 questions. I have answered question 1 ok, but i am pulling my hair out with question 2 and it is worth an additonal 40% or so, any help would be GREATLY appreciated, I know people are very busy, so if you do not want to help, then I am fine with that, but please dont flame me for asking for help, I have never asked for help before on here. Anyways here are the questions:
Description of the Game - Task 1 (9 marks) The task for this coursework is to develop a simulation of the classic "sliding square tiles" game we all, probably, played when we were young.
The game consists of 8 piece sliding buttons holding numbers 1 to 8, and one square blank space. Initially the 8 tiles are placed in a sorted order with the blank square in the lower right-hand corner.
To start the game, you need to first shuffle the pieces by clicking on the shuffle button.
The task is to rearrange the buttons in their numerical order by sliding only one button at a time, ending up with the blank space back in the lower right-hand corner. The game ends when all the buttons are arranged in a consecutive order with "1" in the upper-left corner.
My answer: <HEAD>
<style>
.bigcell {
background-color:#aa9966;
border:4px solid #aa9966;
text-align:center;
}
.cell {
width:40px;
height:40px;
font-family:Verdana, Arial;
font-size:10pt;
font-weight:bold;
background-color:#FF7F50;
color:#ffff33;
border-top:2px solid #aa9966;
border-left:2px solid #aa9966;
border-right:2px solid #663300;
border-bottom:2px solid #663300;
text-align:center;
}
.hole {
width:40px;
height:40px;
background-color:#7FFFD4;
text-align:center;
}
body,h1,h2,h3,.msg,capt1,capt2 {font-family:Verdana,Comic Sans MS,Arial;}
This works fine, it is the question that follows which has really bitten me in the ass
Task 2
Record Names of Players: (8 marks) At the end of every game your program should display the names and scores of the five players with the highest score (those who finished the game with the shortest time). If your player score is one of the highest then update your file to reflect the new score results.
Add a button to your game board to allow for the user of your system to display the names and scores of the 5 players with the highest points.
ANY HELP WOULD BE APRRECIATED, THANK YOU FOR TAKING THE TIME OUT TO READ THIS.
I?ve never coded in Javascript but my idea would be to have an array of 5 position holding the top 5 times, anytime a new player wins the game histime is compared with the values on the array, if its lower then its place in the array is found and the array is updated. I hope there is a Time library for Javascript.
To show the records HTML page you would only need to read this array and print the times inside of it.
I hope the lecturer accepts this, it is a java module, i am used to coding in javascript from doing various websites, but it is a java module, but then the soursecode is essentially java.