From b6e915b999123c83e2d8bd627a4fefe123e7fd6a Mon Sep 17 00:00:00 2001 From: Peter Larson Date: Thu, 20 Apr 2023 11:41:30 -0500 Subject: [PATCH] Update README.md --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index 787ad9d..0765ca7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,34 @@ # TCA-Snake-2 [![xcodebuild](https://github.com/p-larson/TCA-Snake-2/actions/workflows/xcodebuild.yml/badge.svg)](https://github.com/p-larson/TCA-Snake-2/actions/workflows/xcodebuild.yml) + +This repository contains the source code for the `macOS` interpretition of the popular game Snake, built with `SwiftUI` and `TCA`. + + + +--- + +# About + +`Snake` is a retro arcade-style game, built in almost every programming language in existance, it's history is similar to that of `Pong`. The whole application is powered by the [Composable Architecture](https://github.com/pointfreeco/swift-composable-architecture) with a focus on composability, modularity, and testing. + +# Architecture + +[`Snake.swift`](https://github.com/p-larson/TCA-Snake-2/blob/8c616eaf6cfb6fdbc770b76b1677acbafb08994d/TCA-Snake%202/Snake.swift) +- [`State`](https://github.com/p-larson/TCA-Snake-2/blob/8c616eaf6cfb6fdbc770b76b1677acbafb08994d/TCA-Snake%202/Snake.swift#L20) +- [`Actions`](https://github.com/p-larson/TCA-Snake-2/blob/8c616eaf6cfb6fdbc770b76b1677acbafb08994d/TCA-Snake%202/Snake.swift#L46) +- [`Reducer`](https://github.com/p-larson/TCA-Snake-2/blob/8c616eaf6cfb6fdbc770b76b1677acbafb08994d/TCA-Snake%202/Snake.swift#L73) + +## Dependencies + +* [**HighScoreClient**](https://github.com/p-larson/TCA-Snake-2/blob/8c616eaf6cfb6fdbc770b76b1677acbafb08994d/TCA-Snake%202/HighScoreClient.swift) +
Acts a database, with a getter and setter method to interact with the stored data which is just for this projects purpose: the + highscore. This, like the other dependencies, doesn't make any real world requests. Simply, this mimicks the structure of a potential + RESTful API get and post request but instead of it being to a server, its just to `UserDefaults`. So yes, this is just a controlled + dependency wrapper for local storage, but this makes it testable and composable! + +* [**CoordinateGenerator**](https://github.com/p-larson/TCA-Snake-2/blob/8c616eaf6cfb6fdbc770b76b1677acbafb08994d/TCA-Snake%202/CoordinateGenerator.swift) +
Represents a third party system with a failable task to generate a `Coordinate` inside of a player's game. This does not actually send a request outside of the system, it's a just to simulate a outside system request. + +## Tests + +[TCA_Snake_2_Tests.swift](https://github.com/p-larson/TCA-Snake-2/blob/8c616eaf6cfb6fdbc770b76b1677acbafb08994d/TCA-Snake%202%20Tests/TCA_Snake_2_Tests.swift)