-1

I have been working my way around a game in swift and just want to create this statement:

if (player1!=null)||(player2!=null)
    println("You are out of the game")

I've already declared a variable for player1 and player2 but how do I go around this?

Majlik
  • 1,082
  • 1
  • 10
  • 20
Ben
  • 1
  • 1

1 Answers1

0

Write it in Swift instead of C:

if player1 != nil || player2 != nil {
    println("You are out of the game")
}
Daniel T.
  • 32,821
  • 6
  • 50
  • 72