Skip to content

Instantly share code, notes, and snippets.

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

Jorge Rubiano Jorger

🏠
Working from home
View GitHub Profile
/**
* 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 {
/**
* 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 = [];
/**
* 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;
"use strict";
const availableUsers = [];
const rooms = [];
/**
* Socket.IO on connect event
* @param {Socket} socket
*/
module.exports = {
io: socket => {
<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,
},
@Jorger
Jorger / readQR.js
Last active February 3, 2021 22:43
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);