Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Kata
- {
- public static string DuckDuckGoose ( Player [] players, int goose )
- {
- if ( goose <= players.Length )
- {
- goose = goose > 0 ? goose - 1 : goose;
- return players[goose].Name;
- }
- else
- {
- return goose % players.Length == 0 ? players[players.Length].Name : players [goose % players.Length].Name;
- }
- }
- public class Player
- {
- public string Name {get;set;}
- public Player (string name)
- {
- this.Name = name;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment