This file contains hidden or 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 GameScene: SKScene { | |
| var points: Int = 0 | |
| var timeLeft: Int = 60 | |
| override func didMoveToView(view: SKView) { | |
| let timerAction = SKAction.resizeToHeight(CGFloat(0), duration: NSTimeInterval(timeLeft)) | |
| timeGraphic.runAction(timerAction, completion: self.endGame) | |
This file contains hidden or 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
| arr_max = (arrlist) -> | |
| # Check to make sure arrlist is an array of arrays, else throw error | |
| throw "Error: argument to arr_max must be an array of arrays" unless arrlist instanceof Array and arrlist[0] instanceof Array | |
| # Set current max to first array element | |
| curr_max = arrlist[0] | |
| # This value will be set every time a larger value is found | |
| # in each level of arr_max_rec | |
| curr_max_val = -Infinity |
This file contains hidden or 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
| net = require 'net' | |
| clients = [] | |
| total = 0 | |
| net.createServer (socket) -> | |
| clients.push socket | |
| ++total | |
| id = clients.length - 1 | |
| name = "User #{total}" |
This file contains hidden or 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
| koa = require 'koa' | |
| app = koa() | |
| generator firstn | |
| initialize: (limit) -> | |
| num = 0 | |
| while num < limit | |
| yield num | |
| num += 1 |