rogymd / tcaminesweeper Goto Github PK
View Code? Open in Web Editor NEWMinesweeper game in Swift UI using the Composable Architecture
License: Other
Minesweeper game in Swift UI using the Composable Architecture
License: Other
What a great job you've done! This is a really well thought-through project, and covers so much ground. So hats off!
I was able to update your project to use 0.33.1 instead of 0.15.0 with a very small change:
// url: "https://github.com/pointfreeco/swift-composable-architecture", .exact("0.15.0")),
url: "https://github.com/pointfreeco/swift-composable-architecture", from: "0.33.1"),
you could also substitute "0.9.0" here instead of "0.33.1" - it will use the highest version under 1.0 it finds
It looks like the definition of IdentifiedArray changed after 0.15.0 (I assume this is why you froze the project there).
There were only a few lines that needed to be changed - you just need to add id:
as a label when updating an element of the identifiable array. You also need to adjust for optionality - hence the ?
s. I marked the four affected lines below with ** delimiters
in Core/MinefieldCore.swift
public extension MinefieldState {
mutating func reveal(_ index: Int) {
self.reveal([index])
}
mutating func reveal(_ indexes: Set<Int>) {
gridInfo.revealed.formUnion(indexes)
gridInfo.flagged.subtract(indexes)
** indexes.forEach { grid.content[id: $0]?.isHidden = false } **
}
mutating func setTile(_ newTile: Tile, for index: Int) {
**grid.content[id: index]?.tile = newTile**
}
mutating func setMarked(_ isMarked: Bool, for index: Int) {
** grid.content[id: index]?.isMarked = isMarked **
if isMarked {
gridInfo.flagged.insert(index)
} else {
gridInfo.flagged.remove(index)
}
}
mutating func setWrongFlag(for index: Int) {
var tileState = grid.content[index]
tileState.isMarked = true
tileState.tile = .mine
tileState.isHidden = false
** grid.content[id: index] = tileState **
}
}
Thanks for providing this project.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.