Swift template doesn't compile in Mars Lander 1

The Swift template doesn’t compile in Mars Lander 1.

Not the only one ; I dunno why “import Foundation” was replaced by “import Glibc” ; all the componentsSeparatedByString are not valid anymore.

Argh, I’ll fix that today. Meanwhile, you can replace Glibc by Foundation.

The problem is that Swift 2.2.1 doesn’t include Foundation anymore so we need to avoid using Foundation if we want to be able to upgrade Swift one day…

You can also use .characters.split{$0 == " "}.map(String.init) instead of .componentsSeparatedByString.

Edit: I’ve changed the template.

Bad news for code golf :smiley:

We won’t upgrade Swift because of that, maybe they will reintroduce Foundation… But in the meantime we prefer to avoid the use of Foundation in case there’s a urgent need to upgrade Swift.

That was a joke, I think I’m the only one trying to code golf with Swift (and that’s not a great success :joy:)

Glibc seems OK ; it provides access to inter alia math functions and gettimeofday, so all puzzles and challenges should remain accessible:

var time = timeval() gettimeofday(&time,nil) print(time)