Created
August 10, 2016 11:37
-
-
Save tristian2/54bc9febfd2be5b30467dfd300e5891d to your computer and use it in GitHub Desktop.
BattleShips port rom GROOVY to c#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//one | |
using System; | |
using System.Collections; | |
using System.Linq; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
Console.WriteLine("Start"); | |
String[] shipTypes = new String[] { "battleship", "cruiser", "destroyer", "submarine" }; | |
foreach (String s in shipTypes) | |
{ | |
Console.WriteLine(s); //no indexer available :-( | |
} | |
for(int i=0; i<shipTypes.Length; i++) { | |
Console.WriteLine(i + " " + shipTypes[i] ); | |
} | |
Console.WriteLine("End"); | |
} | |
} | |
//two consider the ship board... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
using System;
using System.Collections;
using System.Linq;
using System.Text;
public class Program
{
public static void Main()
{
}