This file contains hidden or 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
/** | |
* Establece una posición aleatoria de una figura en el escenario | |
* @param {*} size | |
* @param {*} board | |
*/ | |
const locateFigure = (size, board) => { | |
const boardSize = DIMENSION_BOARD - 1; | |
let position = []; | |
do { |
This file contains hidden or 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
/** | |
* Crea un nuevo board, estableciendo la posición de las figuras en la misma | |
* @param {*} showFigure | |
*/ | |
const createBoard = (showFigure = 1) => { | |
const board = [...new Array(DIMENSION_BOARD)].map(() => | |
new Array(DIMENSION_BOARD).fill(0) | |
); | |
const figures = []; |
This file contains hidden or 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
/** | |
* Inferir un ataque teniendo posiciones conocidas. | |
* @param {*} board | |
*/ | |
const inferAttack = board => { | |
const boardSize = DIMENSION_BOARD - 1; | |
let newRow = 0; | |
let newCol = 0; | |
let inferredAttack = false; |
This file contains hidden or 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
"use strict"; | |
const availableUsers = []; | |
const rooms = []; | |
/** | |
* Socket.IO on connect event | |
* @param {Socket} socket | |
*/ | |
module.exports = { | |
io: socket => { |
This file contains hidden or 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
<div className="game-grid-wrapper-character"> | |
{characters.map((character, index) => { | |
const left = | |
character[character.isRunning ? "destinationLeft" : "left"]; | |
const top = | |
character[character.isRunning ? "destinationTop" : "top"]; | |
const spring = useSpring({ | |
config: { | |
duration: 500, | |
}, |
This file contains hidden or 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
import "./styles.css"; | |
import { decodeUrlLevel, validURL } from "../../utils/helpers"; | |
import { useState } from "react"; | |
import QrcodeDecoder from "qrcode-decoder"; | |
import swal from "sweetalert"; | |
const qr = new QrcodeDecoder(); | |
const randomString = () => Math.random().toString(36); |
OlderNewer