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
2023-11-27 MIT LICENSE | |
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com. | |
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town. | |
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. | |
It's much easier than you think and you'll be shocked by how relatively well it works with little work. |
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
// refs: | |
// 1. https://stackoverflow.com/questions/71638739/validating-firebase-auth-tokens-manually | |
// 2. https://gist.github.com/bcnzer/e6a7265fd368fa22ef960b17b9a76488 | |
// Once it is verified, you should check the payload as described in the Firebase doc: | |
// https://firebase.google.com/docs/auth/admin/verify-id-tokens#verify_id_tokens_using_a_third-party_jwt_library | |
async function verify(token) { | |
const decodedToken = decodeJwt(token) | |
console.log(JSON.stringify(decodedToken)); |
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
CATransaction.begin() | |
CATransaction.setCompletionBlock { | |
// perform cleaning here | |
} | |
view.layer.add(animationGroup, forKey: nil) | |
CATransaction.commit() |
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
animationGroup.duration = duration |
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
let animationGroup = CAAnimationGroup() | |
animationGroup.animations = [ | |
// put your sub animations here | |
] |
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
let animation = CABasicAnimation(keyPath: #keyPath(CALayer.opacity)) | |
animation.toValue = 0 |
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
let animation = CABasicAnimation(keyPath: #keyPath(CALayer.transform)) | |
let angle = CGFloat.random(in: ) * CGFloat.pi | |
let rotation = CATransform3DMakeRotation(angle, 0, 1, 0) | |
let finalScale = CGFloat.random(in: 2…5) | |
let transoform = CATransform3DScale(rotation, finalScale, finalScale, 1) | |
animation.toValue = transoform |
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
let animation = CAKeyframeAnimation(keyPath: #keyPath(CALayer.position)) | |
animation.path = path.cgPath |
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
let path = UIBezierPath() | |
path.move(to: startPoint) | |
let endPoint = CGPoint(x: posX + CGFloat.random(in: ), y: 0) | |
let controlPoint1 = CGPoint(x: , y: ) | |
let controlPoint2 = CGPoint(x: , y: ) | |
path.addCurve(to: endPoint, controlPoint1: controlPoint1, controlPoint2: controlPoint2) |
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 Solution { | |
func updateBoard(_ board: [[Character]], _ click: [Int]) -> [[Character]] { | |
let h = board.count | |
let w = board[0].count | |
var copied = board | |
func checkAdjacentPoints(x: Int, y: Int) { | |
var numberOfBombs = 0 | |
NewerOlder