You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
621B

  1. let a = [
  2. [1, 2, 3],
  3. [4, 5, 6],
  4. [7, 8, 9]
  5. ]
  6. const prompt = require('prompt-sync')({ sigint: true });
  7. ticTacToe(a);
  8. function ticTacToe(a) {
  9. let pipe = "|";
  10. for (let x = 0; x < a.length; x++) {
  11. let row = a[x];
  12. let column = '';
  13. for (let y = 0; y < row.length; y++) {
  14. column = column.toString() + pipe;
  15. column = column.toString() + row[y].toString();
  16. }
  17. column = column.toString() + pipe;
  18. console.log(column)
  19. }
  20. }
  21. getUserInput();
  22. function getUserInput() {
  23. return prompt("Was ist deine Eingabe?");
  24. }
  25. //console.log(input);