Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
La condición es falsa, pero aún se ejecuta

tengo este codigo

 const prompt = require("prompt-sync")({ sigint: true }); var cmd var start = 0; var stats = { "player1": { "name": "", "money": 0, "properties": [], "position": 0, }, "player2": { "name": "", "money": 0, "properties": [], "position": 0, }, "player3": { "name": "", "money": 0, "properties": [], "position": 0, }, "player4": { "name": "", "money": 0, "properties": [], "position": 0, }, "player5": { "name": "", "money": 0, "properties": [], "position": 0, } } cmd = prompt("There can be 5 players. Enter the first player's name: ") stats.player1.name = cmd; cmd = prompt("Enter the second player's name: ") stats.player2.name = cmd; cmd = prompt("Enter the third player's name. Type 0 to start: ") if (cmd != 0) { stats.player3.name = cmd; } else { start = true; } cmd = prompt("Enter the fourth player's name. Type 0 to start: ") if (start != true) { if (cmd != 0) { stats.player4.name = cmd; } else { start = true; } } cmd = prompt("Enter the fifth player's name, Type 0 to start: ") if (start != true) { if (cmd != 0) { stats.player5.name = cmd; } else { start = true; } } while (start = true) { cmd = prompt("Enter a command: ") }

Pero cuando llego a la declaración "Ingrese el nombre del tercer jugador. Escriba 0 para comenzar" y escriba 0, pasa esta declaración pero se detiene en la cuarta declaración. Esperaba que cuando escriba 0, iniciará el juego automáticamente. Utilicé prompt-sync para la entrada del usuario. Soy malo en bucles; por favor ayudame =[

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!