public static void Main(string[] args){
int[,] spielfeld = new int[10, 10];
spielanzeigen(ref spielfeld);
Random zz = new Random();
int ships = zz.Next(1, 11);
spielgenerieren(ref spielfeld, ships);
Console.WriteLine("where would you like your choice to be?");
bool shoot = trefferchecken(ref spielfeld, x, y);
spielanzeigen(ref spielfeld, true);
Console.WriteLine("You won! Steps: " + steps);
public static void spielanzeigen(ref int[,] spielfeld, bool hidden = false){
for (int i = 0; i < 10; i++){
for (int j = 0; j < 10; j++){
if(hidden && (spielfeld[i, j] == 0 || spielfeld[i, j] == 1)){
Console.Write(" " + spielfeld[i, j]);
public static void spielgenerieren(ref int[,] spielfeld, int anzahlschiffe_gesamt){
Console.WriteLine("the were " + anzahlschiffe_gesamt + " ships created");
int counter = anzahlschiffe_gesamt;
Random zz = new Random();
if (spielfeld[x, y] == 0){
public static int MakingChoice(){
int z = Convert.ToInt32(Console.ReadLine());
public static bool trefferchecken(ref int[,] spielfeld, int tip_reihe, int tip_spalte){
if (spielfeld[tip_reihe, tip_spalte] == 1){
spielfeld[tip_reihe, tip_spalte] = 9;
spielfeld[tip_reihe, tip_spalte] = 5;