Skip to content

This project is a collection of command-line games implemented in Swift. that includes different types of games such as math games, bomb games, and flag games.

License

Notifications You must be signed in to change notification settings

nsswifter/CommandLineGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  Command-line Game

This project is a command-line game collection that includes different types of games such as math games, bomb defusing games, and flag-guessing games. The project is written in Swift and utilizes various programming concepts and skills, including Protocol-Oriented Programming (POP), Project organization and file structure (Clean Architecture), String manipulation using Result Builder and Extension and et cetera. The project also incorporates colorful and styled text output in the terminal to enhance the user experience (Terminal styling using ANSI escape codes).

Introduction Demo.

Table of Contents

Project Diagram

.
├── CommandLineGame
│   ├── App
│   │   ├── Controller
│   │   │   └── GameController.swift
│   │   └── View
│   │       ├── MessageView.swift
│   │       └── ResultBuilder
│   │           └── PrintExpensiveString.swift
│   ├── Core
│   │   ├── Entity
│   │   │   ├── BombGame.swift
│   │   │   ├── FlagGame.swift
│   │   │   ├── Game.swift
│   │   │   └── MathGame.swift
│   │   ├── Extention
│   │   │   └── StringColorsAndStyles.swift
│   │   └── ValueObjects
│   │       └── GameColor.swift
│   └── main.swift
│ 
├── CommandLineGame.xcodeproj
│ 
├── Documentation
│   ├── bombGame.mov
│   ├── flagGame.mov
│   ├── intro.mov
│   ├── mathGame.mov
│   └── usage.mov
│ 
├── LICENSE
│ 
└── README.md

Games Lists

The following games are currently included:

MathGame Demo.

BombGame Demo.

FlagGame Demo.

Each game has its own set of rules and gameplay mechanics. See the documentation in each respective file for more information.

Note

You can change the content of celebrateVictory() function from Game Controller to customize secret box's content. 🎁

Installation

To install this project, simply clone the repository to your local machine:

git clone https://github.com/mehdi2003karami/CommandLineGame.git

Usage

To run the game via Xcode simply build and run it.

  • Note: Make Sure that Terminal scheme is chosen.

To run the game via Terminal, navigate to the inner CommandLineGame directory and run the main.swift file for the game you wish to play:

swiftc \
main.swift \
App/Controller/GameController.swift \
App/View/MessageView.swift \
App/View/ResultBuilder/PrintExpensiveString.swift \
Core/Entity/BombGame.swift \
Core/Entity/FlagGame.swift \
Core/Entity/Game.swift \
Core/Entity/MathGame.swift \
Core/Extention/StringColorsAndStyles.swift \
Core/ValueObjects/GameColor.swift

Then enter the below command to execute compiled file.

./main

Usage Demo.

Contributors

Feel free to share your ideas or any other problems. Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

License

CommandLine Game is released under an MIT license. See LICENSE for more information.

About

This project is a collection of command-line games implemented in Swift. that includes different types of games such as math games, bomb games, and flag games.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages