Last active
July 19, 2021 20:06
-
-
Save marc-morris/579d41ee1ce420391a6ff693cc71b3b5 to your computer and use it in GitHub Desktop.
Team 5 - Eridian Clock (Marc, Safia, Ryan, Matt)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const numbersHash = { | |
0: 'ℓ', | |
1: 'I', | |
2: 'V', | |
3: 'λ', | |
4: '+', | |
5: '∀' | |
}; | |
const NUMBER_BASE = 6; | |
const ERIDIAN_SECOND = 2366; | |
let secondsOnes = 0; | |
let secondsTens = 0; | |
let minutesOnes = 0; | |
let minutesTens = 0; | |
let hours = 4; | |
const countTime = () => { | |
secondsOnes = secondsOnes += 1 | |
if(secondsOnes === NUMBER_BASE) { | |
secondsOnes = 0 | |
secondsTens = secondsTens += 1 | |
} | |
if(secondsTens === NUMBER_BASE) { | |
secondsTens = 0 | |
minutesOnes = minutesOnes += 1 | |
} | |
if(minutesOnes === NUMBER_BASE) { | |
minutesOnes = 0 | |
minutesTens = minutesTens += 1 | |
} | |
if(minutesTens === NUMBER_BASE) { | |
minutestens = 0 | |
hours = hours += 1 | |
} | |
if(hours === NUMBER_BASE) { | |
hours = 0 | |
} | |
const eridianTime = `${numbersHash[hours]}:${numbersHash[minutesTens]}${numbersHash[minutesOnes]}:${numbersHash[secondsTens]}${numbersHash[secondsOnes]}` | |
const readableEridianTime = `${hours}:${minutesTens}${minutesOnes}:${secondsTens}${secondsOnes}` | |
console.log({eridianTime, readableEridianTime}) | |
}; | |
const startClock = setInterval(countTime, ERIDIAN_SECOND) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment