Back end - RenskeBrummel/RenskeBrummel.github.io GitHub Wiki
Welcome to the Back-end page!
Here you'll find all the things you want to know about the codes we used for our back-end.
Our back-end developer is responsible for our underlying codes.
The back-end developer makes sure that everything you actually can't see while playing the game is in place.
Maud is our hero in giving our objects a purpose and blowing life into our game.
Number generator
At first Maud helped setting up the main bingo card as fast as possible so she could get to her own tasks.
When the bingo card was set up and the boxes of the bingo card were ready she could create a script for the boxes to generate a random number when the game is set up.
She created a script to generate these random numbers and origionally you could choose a random number from 1 to 70.
The chance that the same number could come up twice is very big, and to create a script that eliminates the fact that two of the same numbers could come up was not our priority, and quite difficult to create.
So Maud decided to give every column under one of the letters of the word bingo their own script and a certain range of numbers that could come up. So underneath the letter:
B numbers 1 to 14
I numbers 15 to 28
N numbers 29 to 42
G numbers 43 to 56
O numbers 57 to 70
So this was the number generator for the card, but we also needed a generator to provide a number to cross off on the card. Maud created another script to now generate one number between 1 and 70.
After that she made sure the generator didn't only show the number but also the letter paired up with the number.
So if a number within the range of the letter I would come up the generator also shows the letter.
She chose for that so the player knows where to look on their card to see if they can cross it off.
Crossing off numbers
After the presentation Maud made sure the player could cross of the numbers on the main card.
If you'd click on a number on the card it the box the number is in would change colour(the colour corresponding with the colour of the letter), and stay that colour. So now you crossed off the number, but we couldn't manage to make sure the player wins when a row is crossed of horizontally, vertically or diagonal.