New answers tagged

1

General remarks The computation should be separated from the program output. That increases the clarity of the program, and makes the functions better testable. In your case, func playertold should return the result instead of printing it. Type annotations are often not needed, e.g. var currentNumber:Int = 1 var currentPlayer:Int = 1 var reversedOrder:Bool ...


Top 50 recent answers are included