Skip to content

Instantly share code, notes, and snippets.

View briyithhhh's full-sized avatar
🏠
Working from home

Briyith Portillo briyithhhh

🏠
Working from home
  • URBE Unversity
  • Zulia, Venezuela
  • 02:49 (UTC -04:00)
  • X @briyitosss
View GitHub Profile
@briyithhhh
briyithhhh / arrays.js
Last active January 2, 2023 21:34
Two arrays to an array of object
const result = (keys, values) => {
return (Object.fromEntries(keys.map((key, i) =>
[key, values[i]]
)))}
result(
["name", "lastname", "born"],
["Briyith", "Portillo", 2002]
)
@briyithhhh
briyithhhh / diamond.js
Last active December 15, 2022 19:54
diamond-pattern
const n = 5
for (let i = 1; i <= n; i++){
for(let j = 1; j <= n - i; j++){
process.stdout.write(' ')
}
for(let k = 0; k < 2 * i - 1; k++){
process.stdout.write('*')
}
console.log()
@briyithhhh
briyithhhh / rock-paper-scissors.js
Created November 26, 2022 00:30
rock-paper-scissors game made in JavaScript
function aleatorio(min,max){
var num = Math.floor( Math.random() * (max - min + 1) + min );
return num;
}
var options = prompt('¿Estas listo para jugar?\nLas opciones son:\n0:Piedra\n1:Papel\n2:Tijera\n\n¡Escoge una opción!')
var game = ["Piedra", "Papel", "Tijera"]
function decision(option, optionPC){