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
doubleUs Int -> Int -> Int | |
doubleUs 0 0 = 0 | |
doubleUs a 0 = a * 2 | |
doubleUs 0 b = b * 2 | |
doubleUs x y = x * 2 + y * 2 |
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
Package of ground organic chicken, half bunch of kale, walnuts, 1 onion, 1 clove garlic, gorgonzola. | |
Mix w hands till well blended. add salt, pepper, red pepper flakes. | |
Spread out on either parchment or pie platepat flat, maybe 3/4 inch to 1/2 inch max. | |
Top pizza w Gorgonzola or other strong cheese (taleggio wd work) and other half onion, diced. | |
Preheat oven to 180 C, in it goes after, raise to 220c for 12 minutes..then lower to 180. | |
There will be a layer of fat and water from kale - remove pizza and pour off, then replace and bake 5 more min with crushed walnuts. | |
Remove from heat. let it cool. Consume. | |
Can even top w sour cream/creme fraiche/smetana. |
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
case ShotFired(by, atX, atY) => by + " fired at (" + atX + "," + atY + ")" |
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
case class MedikitUsed(val name: String, val useAmount: Int) | |
val result = new MedikitUsed("Sean", 0) match { | |
case MedikitUsed(name, 0) => name + " attempted to use none of their medikit and that makes no sense." | |
} |
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
abstract class SpecialWeapon | |
case class SpecialWeaponUsed(val player: String, val weapon: SpecialWeapon) | |
case class NuclearBomb(val megatons: Int) extends SpecialWeapon | |
val result = new SpecialWeaponUsed("Sean", new NuclearBomb(17)) match { | |
case SpecialWeaponUsed(name, NuclearBomb(megatons)) => name + " used a " + megatons + " megaton nuclear bomb." | |
} |
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
String intMatch(int number) { | |
switch (number) { | |
case 1: return "This is number 1."; | |
case 2: return "This is number 2, it comes after 1."; | |
default: return "This number is neither 1 nor 2."; | |
} | |
} |
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
def intMatch(number: Int): String = { | |
return number match { | |
case 1 => "This is number 1." | |
case 2 => "This is number 2, it comes after 1." | |
case _ => "This number is neither 1 nor 2." | |
} | |
} |
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
def anyMatch(something: Any): String = { | |
return something match { | |
case text: String => text | |
case number: Int => "This is the number " + number + "." | |
case _ => "Unknown thing." | |
} | |
} |
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
def positiveIntMatch(number: Int): String = { | |
return number match { | |
case positive: Int if positive >= 0 => positive + " is greater than or equal to zero." | |
case negative: Int => negative + " is less than zero." | |
} | |
} |
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
case class ShotFired(val playerName: String, val atX: Int, val y: Int) | |
val result = new ShotFired("Sean", 2, 5) match { | |
case ShotFired(by, atX, atY) => by + " fired at (" + atX + "," + atY + ")" | |
} |