Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
GrimReaper2654 committed Aug 17, 2024
1 parent cdbc4b8 commit 4812a6a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
14 changes: 9 additions & 5 deletions Game/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const ptable = [
[{question: 'Name: ', answer: ['Nickel','nickel'], given: true},{question: 'Symbol: ', answer: ['Ni'], given: true},{question: 'Atomic Number: ', answer: ['28'], given: true},{question: 'Mass number: ', answer: ['58.69'], given: false},{question: 'Valence: ', answer: ['2+','2','+2'], given: false}],
[{question: 'Name: ', answer: ['Copper','copper'], given: true},{question: 'Symbol: ', answer: ['Cu'], given: true},{question: 'Atomic Number: ', answer: ['29'], given: true},{question: 'Mass number: ', answer: ['63.55'], given: false},{question: 'Valence: ', answer: ['2+','2','+2','1+','1','+1','+'], given: false}],
[{question: 'Name: ', answer: ['Zinc','zinc'], given: true},{question: 'Symbol: ', answer: ['Zn'], given: true},{question: 'Atomic Number: ', answer: ['30'], given: true},{question: 'Mass number: ', answer: ['65.38'], given: false},{question: 'Valence: ', answer: ['2+','2','+2'], given: false}],

];

const polyatomicIons = [
Expand Down Expand Up @@ -69,8 +68,6 @@ const polyatomicIons = [
];

var questions = [];
questions = questions.concat(ptable);
questions = questions.concat(polyatomicIons);

var disabled = {
name: false,
Expand Down Expand Up @@ -250,6 +247,7 @@ function check() {
var ans = questions[currentAnswer];
for (var i = 0; i < ans.length; i += 1) {
if (document.getElementById(`Q${i}`)) {
if (document.getElementById(`Q${i}`).value == 'idk') continue;
var match = false;
for (var j = 0; j < ans[i].answer.length; j +=1 ) {
if (document.getElementById(`Q${i}`).value == ans[i].answer[j]) {
Expand Down Expand Up @@ -292,7 +290,7 @@ function hint() {
document.getElementById(`Q${i}`).value = ans[i].answer[0]
}
}
brainSize -= 10;
brainSize -= 5;
first = false;
winStreak = 0;
hintUsed = true;
Expand Down Expand Up @@ -327,7 +325,13 @@ function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
};

async function main() {
async function main(elements, ions) {
for (let i = 0; i < elements; i++) {
questions.push(ptable[i]);
}
for (let i = 0; i < ions; i++) {
questions.push(polyatomicIons[i]);
}
load();
while (1) {
await sleep(1000/60);
Expand Down
14 changes: 11 additions & 3 deletions Game/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,19 @@
<h1>Chemistry Revision</h1>
</div>
<div id="main">


<p>A tool to help with memorising the first 30 elements of the periodic table as well as some common polyatomic ions.</p>
<p>Whether certain proterties are assessed can be toggled. Useful when you don't want to have to memorise the molar mass of everything for example.</p>
<p>answer 'idk' if you feel like a property is too irrelavent but can't be bothered disabling it. (Can be abused to get high scores)</p>
<p>Beware of jump scares when questions are repeatedly answered incorrectly.</p>
<p>Different sets of flash cards are avalaible. Select below.</p>
<p>Note: I made this several years ago, pls don't judge terribly written code. If bugs exist or features wanted, make an issue on the github repo.</p>
</div>
<div id="controlPannel">
<button onclick="main();"><h4>Start</h4></button>
<button onclick="main(30, 25);"><h4>All Elements and Ions</h4></button>
<button onclick="main(20, 0);"><h4>First 20 Elements</h4></button>
<button onclick="main(30, 0);"><h4>First 30 Elements</h4></button>
<button onclick="main(0, 25);"><h4>Polyatomic Ions Only</h4></button>
<button onclick="main(20, 25);"><h4>First 20 + Polyatomic Ions</h4></button>
</div>
<div id="description">

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Chemistry-Revision
Just something for me to practive chemistry <br>
A tool to help with memorising the first 30 elements of the periodic table as well as some common polyatomic ions.<br>
Whether certain proterties are assessed can be toggled. Useful when you don't want to have to memorise the molar mass of everything for example.<br>
Beware of jump scares when questions are repeatedly answered incorrectly.<br>
For the atomic mass and valencies, you can answer 'IDK' to skip them if they are too difficult or irrelevant.<br>
The Failure and Stooid memes are by Steven He and the brain images were take from a random brain expanding meme.<br><br>
Link: https://grimreaper2654.github.io/Chemistry-Revision/Game/main.html<br>
Expand Down

0 comments on commit 4812a6a

Please sign in to comment.