tetris

๐ŸŽฎ A C++20 Tetris game running in the Linux terminal.๏ผˆไฝฟ็”จC++20ๅผ€ๅ‘็š„Linux็ปˆ็ซฏ็‰ˆไฟ„็ฝ—ๆ–ฏๆ–นๅ—ๆธธๆˆใ€‚๏ผ‰

https://github.com/zhuagenborn/tetris

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • โœ“
    CITATION.cff file
    Found CITATION.cff file
  • โœ“
    codemeta.json file
    Found codemeta.json file
  • โœ“
    .zenodo.json file
    Found .zenodo.json file
  • โ—‹
    DOI references
  • โ—‹
    Academic publication links
  • โ—‹
    Academic email domains
  • โ—‹
    Institutional organization owner
  • โ—‹
    JOSS paper metadata
  • โ—‹
    Scientific vocabulary similarity
    Low similarity (6.6%) to scientific vocabulary

Keywords

cpp20 game tetris
Last synced: 4 months ago · JSON representation ·

Repository

๐ŸŽฎ A C++20 Tetris game running in the Linux terminal.๏ผˆไฝฟ็”จC++20ๅผ€ๅ‘็š„Linux็ปˆ็ซฏ็‰ˆไฟ„็ฝ—ๆ–ฏๆ–นๅ—ๆธธๆˆใ€‚๏ผ‰

Basic Info
  • Host: GitHub
  • Owner: Zhuagenborn
  • License: mit
  • Language: C++
  • Default Branch: main
  • Homepage:
  • Size: 46.9 KB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
cpp20 game tetris
Created over 2 years ago · Last pushed about 1 year ago
Metadata Files
Readme License Citation

README.md

Tetris

C++ CMake Docker GitHub Actions Linux License

Introduction

Cover

A Tetris game running in the Linux terminal.

Prerequisites

Building

Set the location to the project folder and run:

bash mkdir build cd build cmake -DTETRIS_BUILD_TESTS=ON .. cmake --build .

Running Tests

Set the location to the build folder and run:

bash ctest -VV

Running the Game

Set the location to the build/bin folder and run:

bash ./tetris -x=<width> -y=<height>

For example:

bash ./tetris -x=10 -y=15

Structure

. โ”œโ”€โ”€ .clang-format โ”œโ”€โ”€ .gitignore โ”œโ”€โ”€ CITATION.cff โ”œโ”€โ”€ CMakeLists.txt โ”œโ”€โ”€ Dockerfile โ”œโ”€โ”€ LICENSE โ”œโ”€โ”€ README.md โ”œโ”€โ”€ cover.png โ”œโ”€โ”€ docs โ”‚ โ””โ”€โ”€ badges โ”‚ โ”œโ”€โ”€ C++.svg โ”‚ โ”œโ”€โ”€ License-MIT.svg โ”‚ โ”œโ”€โ”€ Linux.svg โ”‚ โ”œโ”€โ”€ Made-with-CMake.svg โ”‚ โ”œโ”€โ”€ Made-with-GitHub-Actions.svg โ”‚ โ””โ”€โ”€ Made-with-Docker.svg โ”œโ”€โ”€ include โ”‚ โ”œโ”€โ”€ args.h โ”‚ โ”œโ”€โ”€ color.h โ”‚ โ”œโ”€โ”€ controller.h โ”‚ โ”œโ”€โ”€ game.h โ”‚ โ”œโ”€โ”€ grid.h โ”‚ โ”œโ”€โ”€ location.h โ”‚ โ”œโ”€โ”€ rotation.h โ”‚ โ”œโ”€โ”€ shape.h โ”‚ โ””โ”€โ”€ tetromino.h โ”œโ”€โ”€ src โ”‚ โ”œโ”€โ”€ CMakeLists.txt โ”‚ โ”œโ”€โ”€ args โ”‚ โ”‚ โ”œโ”€โ”€ CMakeLists.txt โ”‚ โ”‚ โ””โ”€โ”€ args.cpp โ”‚ โ”œโ”€โ”€ color โ”‚ โ”‚ โ”œโ”€โ”€ CMakeLists.txt โ”‚ โ”‚ โ””โ”€โ”€ color.cpp โ”‚ โ”œโ”€โ”€ controller โ”‚ โ”‚ โ”œโ”€โ”€ CMakeLists.txt โ”‚ โ”‚ โ”œโ”€โ”€ controller.cpp โ”‚ โ”‚ โ””โ”€โ”€ ui โ”‚ โ”‚ โ”œโ”€โ”€ board.h โ”‚ โ”‚ โ”œโ”€โ”€ color_env.cpp โ”‚ โ”‚ โ”œโ”€โ”€ color_env.h โ”‚ โ”‚ โ”œโ”€โ”€ grid_board.h โ”‚ โ”‚ โ”œโ”€โ”€ next_tetromino_board.h โ”‚ โ”‚ โ””โ”€โ”€ score_board.h โ”‚ โ”œโ”€โ”€ game โ”‚ โ”‚ โ”œโ”€โ”€ CMakeLists.txt โ”‚ โ”‚ โ””โ”€โ”€ game.cpp โ”‚ โ”œโ”€โ”€ grid โ”‚ โ”‚ โ”œโ”€โ”€ CMakeLists.txt โ”‚ โ”‚ โ””โ”€โ”€ grid.cpp โ”‚ โ”œโ”€โ”€ location โ”‚ โ”‚ โ””โ”€โ”€ CMakeLists.txt โ”‚ โ”œโ”€โ”€ main.cpp โ”‚ โ”œโ”€โ”€ rotation โ”‚ โ”‚ โ”œโ”€โ”€ CMakeLists.txt โ”‚ โ”‚ โ””โ”€โ”€ rotation.cpp โ”‚ โ”œโ”€โ”€ shape โ”‚ โ”‚ โ””โ”€โ”€ CMakeLists.txt โ”‚ โ””โ”€โ”€ tetromino โ”‚ โ”œโ”€โ”€ CMakeLists.txt โ”‚ โ”œโ”€โ”€ subtype โ”‚ โ”‚ โ”œโ”€โ”€ i.h โ”‚ โ”‚ โ”œโ”€โ”€ j.h โ”‚ โ”‚ โ”œโ”€โ”€ l.h โ”‚ โ”‚ โ”œโ”€โ”€ o.h โ”‚ โ”‚ โ”œโ”€โ”€ s.h โ”‚ โ”‚ โ”œโ”€โ”€ t.h โ”‚ โ”‚ โ””โ”€โ”€ z.h โ”‚ โ””โ”€โ”€ tetromino.cpp โ””โ”€โ”€ tests โ”œโ”€โ”€ CMakeLists.txt โ”œโ”€โ”€ grid_test.cpp โ”œโ”€โ”€ rotation_test.cpp โ””โ”€โ”€ tetromino_test.cpp

Class Diagram

```mermaid classDiagram

class Colored { <> GetColor() Color SetColor(Color) }

class Rotatable { <> RotateLeft() RotateRight() GetAngle() Angle RotateTo(Angle) }

class Locatable { <> GetPosition() Point }

class Movable { <> SetPosition(Point) }

Locatable <|-- Movable

class Shape { <> GetHeight() int GetWidth() int Filled(Point) bool }

class Tetromino { <> GetTetrominoByAngle(Angle) Tetromino }

Shape <|.. Tetromino Rotatable <|.. Tetromino Colored <|.. Tetromino

Tetromino <|-- I Tetromino <|-- O Tetromino <|-- J Tetromino <|-- L Tetromino <|-- S Tetromino <|-- T Tetromino <|-- Z

class Grid { GetColor(Point) Color PushTetromino(Tetromino, Point) bool MoveTetrominoToLeft() bool MoveTetrominoToRight() bool RotateTetrominoLeft() bool RotateTetrominoRight() bool TetrominoDescend(int& clearedlinecount) bool }

Shape <|.. Grid Grid *-- Tetromino

Movable <|.. MovableTetromino MovableTetromino --> Tetromino Grid --> MovableTetromino

class Action { <> Non MoveToLeft MoveToRight RotateLeft RotateRight Descend }

class Game { Start() Act(Action) ActionResult GetNextTetrominoes() Tetromino GetScore() int IsOver() bool }

Game --> Grid Game ..> Action

class Controller { Input() Update() Refresh() }

Controller --> Game ```

License

Distributed under the MIT License. See LICENSE for more information.

Owner

  • Name: Zhuagenborn
  • Login: Zhuagenborn
  • Kind: organization
  • Location: Ireland

Software Development | Artificial Intelligence | Reverse Engineering.

Citation (CITATION.cff)

cff-version: 1.2.0
authors:
- family-names: Chen
  given-names: Zhenshuo
  orcid: https://orcid.org/0000-0003-2091-4160
- family-names: Liu
  given-names: Guowen
  orcid: https://orcid.org/0000-0002-8375-5729
title: Tetris
date-released: 2023-04-30
url: https://github.com/Zhuagenborn/Tetris

GitHub Events

Total
  • Push event: 2
Last Year
  • Push event: 2

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/build-test.yaml actions
  • actions/checkout main composite
  • actions/download-artifact main composite
  • actions/upload-artifact main composite
Dockerfile docker
  • ubuntu latest build