Advertisement
mess0011

proj3_3

Nov 11th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.67 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace battleship
  8. {
  9.     class Program
  10.     {
  11.         public static void generategame(ref int[,] board, int ships)
  12.         {
  13.             int battleship = 2;
  14.             int rowingboat = 4;
  15.             int cruiser = 6;
  16.             Random s1 = new Random();
  17.             Random s2 = new Random();
  18.             Random s3 = new Random();
  19.  
  20.             battleship = s1.Next(10, 10);
  21.             rowingboat = s2.Next(10, 10);
  22.             cruiser = s3.Next(10, 10);
  23.  
  24.             //board[4, 4] = battleship;
  25.             //board[2, 3] = rowingboat;
  26.             //board[10, 0] = cruiser;
  27.  
  28.         }
  29.  
  30.         public static void showgame(ref int[,] board)
  31.         {  
  32.             for (int row = 0; row< 10; row++)
  33.             {
  34.                 for (int column = 0; column < 10; column++)
  35.  
  36.                     Console.WriteLine(board[row, column]+ " ");
  37.             }
  38.            
  39.         }
  40.  
  41.         public static bool checklist(ref int[,] board, int row, int column)
  42.         {
  43.  
  44.  
  45.         }
  46.         static void Main(string[] args)
  47.         {
  48.  
  49.             int[,] board = new int[10, 10];
  50.             if (grid[row, column].Equals('1'))
  51.             {
  52.                 grid[row, column] = '9';
  53.                 Console.Clear();
  54.                 Console.WriteLine("Hit!");
  55.                 hitCount += 1;
  56.             }
  57.             else
  58.             {
  59.                 grid[row, column] = '5';
  60.                 Console.Clear();
  61.                 Console.WriteLine("Miss!");
  62.             }
  63.  
  64.  
  65.             Console.ReadLine();
  66.         }
  67.  
  68.        
  69.     }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement