Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace C_Sharp_Junior
- {
- class Program
- {
- static void Main(string[] args)
- {
- SeaBattle seaBattle = new SeaBattle();
- seaBattle.DrawingMap();
- Console.ReadKey();
- }
- }
- class SeaBattle
- {
- private User user;
- public SeaBattle()
- {
- user = new User();
- }
- public void DrawingMap()
- {
- char[,] myGameMap = {{' ', ' ', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '&'},
- {' ', '&', '&', '&', '&', '&', '&', '&', '&', '&', '&', '&', '&'},
- {'A', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'Б', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'В', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'Г', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'Д', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'Е', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'Ё', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'Ж', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'З', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'И', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {' ', '&', '&', '&', '&', '&', '&', '&', '&', '&', '&', '&', '&'}};
- char[,] enemyGameMap = {{' ', ' ', '1', '2', '3', '4', '5', '6', '7', '8', '9', '1', '&'},
- {' ', '&', '&', '&', '&', '&', '&', '&', '&', '&', '&', '&', '&'},
- {'A', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'Б', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'В', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'Г', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'Д', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'Е', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'Ё', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'Ж', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'З', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {'И', '&', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '&'},
- {' ', '&', '&', '&', '&', '&', '&', '&', '&', '&', '&', '&', '&'}};
- Console.WriteLine(" Моё поле");
- for (int i = 0; i < myGameMap.GetLength(0); i++)
- {
- for (int j = 0; j < myGameMap.GetLength(1); j++)
- {
- Console.Write(myGameMap[i,j]);
- }
- Console.WriteLine();
- }
- Console.SetCursorPosition(16, 0);
- Console.WriteLine("Вражеское поле");
- for (int i = 0; i < enemyGameMap.GetLength(0); i++)
- {
- Console.SetCursorPosition(17, i + 2);
- for (int j = 0; j < enemyGameMap.GetLength(1); j++)
- {
- Console.Write(enemyGameMap[i, j]
- }
- Console.WriteLine();
- }
- }
- }
- class User
- {
- public void ChoosingAttackLocation()
- {
- Console.SetCursorPosition(0, 20);
- Console.WriteLine("Введите номер клетки:");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement