Code Monkey home page Code Monkey logo

oo-boggle's Introduction

Object oriented boggle game with HTTP interface

Licensed under Apache-2.0 CircleCI build status Codecov reports Hits-of-Code Swagger UI

A reactive object oriented implementation of the Boggle game with a HTTP interface. The latter is implemented with Vert.x.

It's written with minimalism, flexibility and object thinking in mind. Indeed, the main just composes bigger objects from smaller ones:

public final class Main {
  public static void main(String[] args) {
    var vertx = Vertx.vertx();
    vertx.deployVerticleAndAwait(
      new HttpInfrastructure(
        new DurationMatches<>(
          new DeadlineMatches<>(
            new ClassicRuledMatches<>(
              new InMemoryMatches<>(
                new MappedGrids<>(
                  new InMemoryGrids<>(
                    Map.of(
                      new FeatureEqualityPredicate(
                        Map.of(
                          "lang", List.of("it"),
                          "size", List.of("4x4")
                        )
                      ),
                      new LangGrid<>(
                        new FourByFourGrid<>(new SixteenItalianDice()), "it"
                      )
                    )
                  ),
                  LayoutGrid::new
                )
              ),
              Map.of(
                new FeatureEqualityPredicate(
                  Map.of(
                    "lang", List.of("it"),
                    "size", List.of("4x4")
                  )
                ),
                match -> new IfInGrid<>(
                  new IfInVocabulary<>(
                    new FourByFourScore<>(),
                    new DizionarioItalianoIt(WebClient.create(vertx))
                  ),
                  match.grid()
                )
              )
            )
          ),
          Duration::ofMinutes
        ),
        parseUnsignedInt(args[0]),
        args[1]
      )
    );
  }
}

How to run

You should first build the uber jar, then you can run it with java. Port and interface are mandatory. For example to run on the 127.0.0.1 interface on the 8080 port:

$ ./mvnw clean package
$ java -jar target/boggle-1.0.0-SNAPSHOT.jar 8080 127.0.0.1

Javadoc

The project is documented through javadoc. To generate it in target/site/apidocs:

$ ./mvnw clean javadoc:javadoc

Code coverage report

The project is covered by tests. To generate code coverage report in target/site/jacoco:

$ ./mvnw clean test jacoco:report

oo-boggle's People

Contributors

raffaeleflorio avatar

Watchers

 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.