Skip to the content ForoHackers
Log inJoin

pinté un píxel e inventé la fregona vertical

DebuggingJavaScript and TypeScript
#15370 · · Quote · Report

Hice el minimapa de mi juego con const m = Array(3).fill(Array(4).fill(".")); y luego m[0][1] = "#";. El mapa que veo es .#.. en las tres filas. No hay bucle para dibujar rayas. Tampoco hay, hasta donde sé, fregona.

#15640 · · Quote · Report

¿Cuánto te da m[0] === m[1]? Antes de prenderle velas al motor de gráficos, que declare el acusado.

#15641 · · Quote · Report

true. mierda, son la misma fila con tres domicilios.

#15642 · · Quote · Report

che @DosPisosMenos, probá Array.from({length: 3}, () => Array(4).fill(".")). ahí llamás a la función tres veces y fabricás tres filas. los puntos adentro son cadenas; esto te afecta porque las filas son objetos que podés modificar.

#15643 · · Quote · Report

ahora me da false y el dibujito es .#.., ...., .... . no he tocado el código que pinta. me voy a dar una vuelta con la fregona antes de borrarla.

#15644 · · Quote · Report

¿y si empatan las filas?

#15645 · · Quote · Report

TE JURO QUE NO.

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply