GithubHelp home page GithubHelp logo

gol's Introduction

Description

Simple demo of Game of Life

Download

git clone [email protected]:yenhsun/Gol.git

Idea

image

MVP-like structure

In this code assignment, I choose MVP-like, such as draft above, as structure with dagger2.

  • View deals with most of Android platform related jobs such as clicking events and updating view state.
  • Presenter handles all of interactions between models/controllers & view. Besides, it also keeps almost all of states of businesss logic.

Testing

Under this MVP-like structure, testing can be easily because of following reasons:

  • Presenter observe all of intents from android framework and most of actions in presenter are triggered by intents. As a result, it is easy to test presenter by sending intents manually.
  • Most of updates in View are in it function View.render(State) and we only need to pass specific State to View.render(State) when testing.
  • It is easy to extract/set objects in View or Presenter when testing by using DI or service locator (Dagger2 in this case).
  • Using Mock framework (mockk in this case), we can verify the input & ouput of test cases.

Others

In case of blocking any UI manipulations, I decided to use HandlerThread to send all commands, from presenter, to GameRunner, the main GOL calculator and both are running on the distinct background threads.

Description

Let g(N) be the count of numbers that contain a 7 when you write out all the numbers from 1 to N

gol's People

Contributors

yenhsun avatar

Watchers

James Cloos 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.