Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
rhirano0715 committed Mar 18, 2023
1 parent 393be85 commit fc4c284
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,35 +45,22 @@
word: columns[1]
});
}

// Call any functions that depend on the wordList array here
// For example:
console.log(wordList);
})
.catch(error => console.error(error));

setInterval(() => {
const textContainer = document.getElementById("text-container");

// Filter the array to get only the words with the desired types
// const filteredList = wordList.filter(word => word.type === 'noun' || word.type === 'verb' || word.type === 'particle');
const nounList = wordList.filter(word => word.type === 'noun');
const particleList = wordList.filter(word => word.type === 'particle');
const verbList = wordList.filter(word => word.type === 'verb');

console.log(nounList);
console.log(particleList);
console.log(verbList);

// Select a random word from the filtered list
const noun = nounList[Math.floor(Math.random() * nounList.length)];
const particle = particleList[Math.floor(Math.random() * particleList.length)];
const verb = verbList[Math.floor(Math.random() * verbList.length)];

console.log(noun);
console.log(particle);
console.log(verb);

textContainer.innerText = noun.word + " " + particle.word + " " + verb.word;
}, 5000);
</script>
Expand Down

0 comments on commit fc4c284

Please sign in to comment.