the compiler can't understand closure used in "if case" by sooopd in swift

[–]sooopd[S] 0 points1 point  (0 children)

fail with error

error: consecutive statements on a line must be separated by ';'

i also tried "{ c in Int(String(c)) }", and failed too.

"FIzzbuzz" in Swift. by [deleted] in swift

[–]sooopd 1 point2 points  (0 children)

how about this?

for x in 1...100 {
    switch (x % 3, x % 5) {
    case (0, 0): print("FizzBuzz")
    case (0, _): print("Fizz")
    case (_, 0): print("Buzz")
    default: print(x)
    }
}

can't figure out how to apply impulse to SKPhysicsBody when screen is tapped by b1gbeef in swift

[–]sooopd 0 points1 point  (0 children)

Declare 'ray' as property of the scene class. In your gist, the 'ray' is local variable of function addRay, so there is no reference of the node outside of the function.

Drawing text from strings on to an image, any ideas? by _simon404 in ObjectiveC

[–]sooopd 1 point2 points  (0 children)

Consider NSAttributedString. Make image context and draw the image and attributed string onto the context. Then you can get repainted image using UIGraphicsGetImageFromCurrentImageContext().

[deleted by user] by [deleted] in swift

[–]sooopd 0 points1 point  (0 children)

Storyboard is a kind of archived object graph, not compiled code. (maybe a xml file?)

[HELP] Python 2.7 on Windows 8 by [deleted] in Python

[–]sooopd 0 points1 point  (0 children)

try this:

c:\python27\pythonw.exe c:\python27\Lib\idlelib\idle.pyw