Giter VIP home page Giter VIP logo

tcaminesweeper's People

Contributors

rogymd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tcaminesweeper's Issues

Update to Current Version of Composable Architecture (0.33.1)

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.