This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
// Add code to print your name | |
System.out.println("REPLACE WITH YOUR NAME"); | |
// Add code to print a message with a truth about yourself (try and think of something interesting) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//change this to a struct and verify the change in behaviour | |
class Number : CustomStringConvertible { | |
var number: Int | |
init(_ num: Int) { | |
number = num | |
} | |
public var description : String { | |
return "\(number)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LiskovPhraseMaker { | |
//class properties | |
private var type = "T" | |
private var subtype = "S" | |
func modifiedLiskovPhrase() -> String{ | |
return "If \(subtype) is a subtype of \(type), then objects of type \(type) may be replaced with objects of type \(subtype) (i.e., objects of type \(subtype) may substitute objects of type \(type)) without altering any of the desirable properties of that program (correctness, task performed, etc.)" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//create node | |
var rectangleSpriteNode = SKSpriteNode() | |
//set sprite colour | |
rectangleSpriteNode.color = UIColor.yellowColor() | |
//set 100 width by 500 high | |
rectangleSpriteNode.size = CGSizeMake(100, 50) | |
//set the position of the node's centre (200 points across, 100 points up) |