Skip to content

Commit

Permalink
Update for Embedded Swift
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Liu <andy@madmachine.io>
  • Loading branch information
andy0808 committed Sep 26, 2024
1 parent 850860b commit b35cd8f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ struct PongGame {
ball.updateAfterHitWall(window: window)
speaker.write(hitWallSound)
}
print(ball.x, ball.y)
print("\(ball.x), \(ball.y)")

// If the ball hits left/right paddle, change the ball's
// direction to bounce it in an opposite direction.
Expand Down Expand Up @@ -189,8 +189,8 @@ struct PongGame {
let size = try file.tell() - headerSize

buffer = [UInt8](repeating: 0, count: size)
try buffer.withUnsafeMutableBytes { rawBuffer in
_ = try file.read(fromAbsoluteOffest: headerSize, into: rawBuffer, count: size)
buffer.withUnsafeMutableBytes { rawBuffer in
_ = try? file.read(fromAbsoluteOffest: headerSize, into: rawBuffer, count: size)
}
try file.close()
} catch {
Expand Down

0 comments on commit b35cd8f

Please sign in to comment.