Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace battleship
- {
- class Program
- {
- public static void generategame(ref int[,] board, int ships)
- {
- int battleship = 2;
- int rowingboat = 4;
- int cruiser = 6;
- Random s1 = new Random();
- Random s2 = new Random();
- Random s3 = new Random();
- battleship = s1.Next(10, 10);
- rowingboat = s2.Next(10, 10);
- cruiser = s3.Next(10, 10);
- //board[4, 4] = battleship;
- //board[2, 3] = rowingboat;
- //board[10, 0] = cruiser;
- }
- public static void showgame(ref int[,] board)
- {
- for (int row = 0; row< 10; row++)
- {
- for (int column = 0; column < 10; column++)
- Console.WriteLine(board[row, column]+ " ");
- }
- }
- public static bool checklist(ref int[,] board, int row, int column)
- {
- }
- static void Main(string[] args)
- {
- int[,] board = new int[10, 10];
- if (grid[row, column].Equals('1'))
- {
- grid[row, column] = '9';
- Console.Clear();
- Console.WriteLine("Hit!");
- hitCount += 1;
- }
- else
- {
- grid[row, column] = '5';
- Console.Clear();
- Console.WriteLine("Miss!");
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement