Git Product home page Git Product logo

2048_java's Introduction

This directory contains my version of the popular game 2048. The size of the game and probabilities of certain numbers appearing are completely configurable.

CONTENTS:
---------

README                 This file.

Makefile               This file provides for some
                       simple compilation/testing control.  See the
                       comments in it for the targets provided.  If you are
                       using Eclipse will need it on the instructional
                       machines (the commands 'make' and 'make check' must
                       work correctly on your submission, regardless of
                       which editor or IDE you used).

game2048/

    Makefile           A Makefile for compiling, style checking, testing, and
                       cleaning up files in this directory.

    Main.java          Entry point to program. This handles program options
                       and sets up the necessary objects to play one or more
                       games.

    Model.java         This class describes game state: the contents of the
                       board and the scores.  It contains the logic for
                       tilting the board so that tiles slide to new positions.

    Tile.java          Describes a single tile on the board.

    Side.java          An enumeration type for the directions in which the
                       board can tilt.  Contains functions that allow you to
                       change the coordinate system---to treat any side of
                       the board as "south" with rows and columns rotated
                       accordingly.

    Game.java          Contains the logic for controlling a game: responding
                       to commands by updating the model as apppropriate.

    InputSource.java   An interface to get input to the game, which consists of
                       keystrokes and random tile positions.  It has two
                       implementing subtypes: GUISource and TestSource.

    GUISource.java     An InputSource that fetches inputs from a user's
                       key presses and generates tiles using a
                       pseudo-random number generator (PRNG).

    TestSource.java    An InputSource that fetches recorded key presses and
                       tile positions from a file, allowing you to create
                       and run tests.

    GUI.java           Represents the graphical display of the game state and
                       receives key presses from the user.  The GUI
                       "observes" the model and responds to changes in it.

    BoardWidget.java   Used by GUI to represent the grid of squares and tiles.

    BoardLogger.java   Another observer of the game state that prints the
                       states of the board to a file, thus allowing one to
                       capture and check the board positions generated by
                       the program.

testing/                 Directory with integration test machinery.

    tester.py          A Python 3 script for testing the program.  It makes
                       use of the --testing option in the program to feed
                       in known moves.
    testing.py         A module that supports testing in general.
    *.in               Test scripts accepted by the tester.
    *.out              The outputs (logged by BoardLogger) expected for each
                       test.

2048_java's People

Contributors

stkhanna avatar sameerkhanna786 avatar

Watchers

James Cloos avatar  avatar

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.