Ik moet een OXO spel maken en ik zit hier vast. kan iemand mij helpen?aub
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package testspel;
import java.util.Scanner;
/**
*
* @author dvdveken
*/
public class Testspel {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// while spel niet gedaan {
// stelVragen(1)
// stelVragen(2)
// drawSpeelbord();
//}
//toon boodschap voor winnaar.
drawSpeelbord();
Scanner scanner = new Scanner(System.in);
}
public static void stelVragen(Integer spelerNummer) {
System.out.println("Welke letter wilt u zetten ? :");
String letter = scanner.next();
System.out.println("Geef kolom nummer :");
String kolomnr = scanner.next();
System.out.println("Geef rij nummer :");
String rijnr = scanner.next();
//TODO invullen in matrix
}
public static void drawSpeelbord () {
System.out.println("x");
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
System.out.print(" _ ");
}
System.out.println("\n");
}
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package testspel;
import java.util.Scanner;
/**
*
* @author dvdveken
*/
public class Testspel {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// while spel niet gedaan {
// stelVragen(1)
// stelVragen(2)
// drawSpeelbord();
//}
//toon boodschap voor winnaar.
drawSpeelbord();
Scanner scanner = new Scanner(System.in);
}
public static void stelVragen(Integer spelerNummer) {
System.out.println("Welke letter wilt u zetten ? :");
String letter = scanner.next();
System.out.println("Geef kolom nummer :");
String kolomnr = scanner.next();
System.out.println("Geef rij nummer :");
String rijnr = scanner.next();
//TODO invullen in matrix
}
public static void drawSpeelbord () {
System.out.println("x");
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
System.out.print(" _ ");
}
System.out.println("\n");
}
}
}
Laatst bewerkt: