Giter Club home page Giter Club logo

dotgame's Introduction

Dot Game

This game is a fun game that I pick for pastime. It's a challenge that could be enjoyable and fun!

Most features of this code:

  • Correctness of implementation
  • Simplisity
  • Security
  • Coehision
  • Fake player
  • Strong input validation

An small project such this should replace to gist. But I want to improve it sometimes on a day of week. This game should be featureful and interesting! Even we can add this game to OpenBSD games XD

Requirements

  • BSD Make

Installation

cd dotgame
bmake
./dotgame -h

How to start game ?

When I was student in some classes of school we didn't listen to teacher and play a fun game. In Iran this game known as نقطه بازی and I say dot game.

In this game users should draw some lines between points. First one who creat a square with lines can own this square and it's ID will place on square. Winner will get a gift and enter new coordination while he is winner.

Sample output:

*--*--*--*--*--*
|B |B |B |B |B |
*--*--*--*--*--*
|B |B |B |B |B |
*--*--*--*--*--*
|A |B |B |A |A |
*--*--*--*--*--*
|B |B |B |B |A |
*--*--*--*--*--*
|B |B |B |B |B |
*--*--*--*--*--*

score(A): 4; score(B): 21;

Game modes

This game have normal and profesional mode based on lenght of 2D array. On normal mode game board should have 4*4 board and on profesional mode board should be 6*6.

Other mode of this game is faker mode. When you enabling this feature, player B will be fake and random.

Arguments

./dotgame [normal|pro] [fake]

Contribution

This project is completely open to contribute and every patch will accepted! Please report all bugs and your recommendations on issues or solve some of this issues!

Accpeted contributions:

  • Reporting bug or recommend feature
  • Refactoring
  • Fix bugs
  • Solve issues
  • Translate README and documentions for wiki
  • Fix typo
  • Add necessary comment for complex codes
  • etc

Please help me to improve this project!

License

We haven't license now. Maybe we pick BSD LICENSE for future.

dotgame's People

Contributors

alirezaarzehgar avatar valarmorgholis avatar

Stargazers

Rodrigo Grande avatar  avatar rfht avatar

Watchers

 avatar

Forkers

valarmorgholis

dotgame's Issues

dotgame.c:25:18: error: unused variable ‘name’

Code is not good and have warning!

cc -pipe -g -Wall -Werror                   -MD -MF dotgame.d -MT dotgame.o           -c dotgame.c
dotgame.c: In function ‘print_matrix’:
dotgame.c:25:18: error: unused variable ‘name’ [-Werror=unused-variable]
   25 |     char *line, *name;
      |                  ^~~~
cc1: all warnings being treated as errors
*** Error code 1

Stop.
bmake: stopped in /home/ali/programming/c/myproj/dotgame

Make essentials fields dynamic

Following fields on game could be dynamic and receive from arguments using getopt.

  • number of players
  • colored line or not
  • mode number or size of game board
  • add fake players to some ID's

Add test for game

TDD is required for future of every projects. For now we need not to unit tests. But system test is required. I suggest bats test.

Add color to lines

Each line should have a color associated to it's owner ID.
This feature can simply implemented using ANSI escape characters.

Feature to online game

It's very good practice to making a game server and make this game online for limited users.
Server should do this:

  • Send game setting and dynamic fields to all clients
  • Send all player actions to all clients
  • Make random actions

Note that server is not single shoot application and lack of cleanup is memory leak.

Migrate to BSD Make

BSD Make is better and easier than GNU Make.
This project can improve with migrating to BSD Make.

Refactor validations

Input validation and checking points for finding square is most complex part of code. This codes should be more easy.

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.