Skip to content

Instantly share code, notes, and snippets.

@un-versed
Last active April 10, 2022 00:00
Show Gist options
  • Save un-versed/cc5027dd355866c986b76acf1f7c360e to your computer and use it in GitHub Desktop.
Save un-versed/cc5027dd355866c986b76acf1f7c360e to your computer and use it in GitHub Desktop.
Preguiça de adivinhar as palavras no term.ooo? Eu tenho a solução! 🤫🤫🤫

term.ooo cheat 🤫🤫🤫

Example

Como rodar?

  • Abra o devTools do seu navegador
  • Só copiar o código do termooo-solution.js e jogar na aba console

Prontinho, você tem a resposta da palavra do dia no term.ooo

Thumbs up

async function getWord() {
const words = await (
await fetch(
'https://gist.githubusercontent.com/un-versed/6373912fbf4649704b6823ea696cfcb1/raw/629137a0d0c7160b94c35013df8d570b31100174/termooo-wordsv2.json',
{ method: 'GET' }
)
).json()
const curDay = () => {
var a = new Date().setHours(0, 0, 0, 0)
return Math.floor((a - new Date(2022, 0, 2, 0, 0, 0, 0)) / 864e5)
}
const solution = words[curDay() % words.length]
alert(`The answer is: ${solution}`)
return solution
}
await getWord()
@un-versed
Copy link
Author

un-versed commented Jan 28, 2022

@imguedes Updated the code! Now it's working ^^

@Umbrose
Copy link

Umbrose commented Feb 3, 2022

Não tá funcionando, mas consegui dar uma volta ao menos para a palavra de hoje.
alterando a linha "return Math.floor((a - new Date(2022, 0, 2, 0, 0, 0, 0)) / 864e5)" para "return Math.floor((a - new Date(2022, 0, 1, 0, 0, 0, 0)) / 864e5)" eu consegui chegar na resposta de hoje. Não sei se isso funciona como solução para outros dias de jogo, mas para o de hoje (03/02/2022) funcionou!

@brendondev
Copy link

brendondev commented Feb 3, 2022

Tá com um bug no math.floor, não está pegando o dia atual. De resto está funcionando, só alterei pra 1 ao invés de 2 e foi.

@Hungaralho
Copy link

Don´t work

@Alexjununo
Copy link

Fiz uma alteração e bombou, troquei a data para o dia da primeira palavra, agora ele acha certinho a posição do array que esta a palavra certa

const curDay = () => { var a = new Date().setHours(0, 0, 0, 0) return Math.floor((a - new Date(2021, 11, 29, 0, 0, 0, 0)) / 864e5) }

@LucasTor
Copy link

LucasTor commented Feb 17, 2022

Vou contribuir um pouquinho ao projeto
É possível fazer a palavra "se digitar" sozinha, usando esse código:

const parsedSolution = solution.normalize("NFD").replace(/[\u0300-\u036f]/g, "")
parsedSolution.split('').forEach(l => $(`#kbd_${l}`).click())
$(`#kbd_enter`).click()

Provavelmente vai precisar receber o $ como parametro da função
Se alguém testar avisa aqui 😃

@brendondev
Copy link

brendondev commented Feb 17, 2022

Testem, aqui funcionou.

async function getWord() {
const words = await (
await fetch(
'https://gist.githubusercontent.com/un-versed/6373912fbf4649704b6823ea696cfcb1/raw/629137a0d0c7160b94c35013df8d570b31100174/termooo-wordsv2.json',
{ method: 'GET' }
)
).json()

const curDay = () => {

  var a = new Date().setHours(0, 0, 0, 0)

  return Math.floor((a - new Date(2021, 11, 29, 0, 0, 0, 0)) / 864e5)

}

const solution = words[curDay() % words.length]



alert(`The answer is: ${solution}`)



return solution

};

await getWord();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment