{"id":21575739,"url":"https://github.com/elennick/reversi","last_synced_at":"2025-03-18T07:12:15.031Z","repository":{"id":24292956,"uuid":"27688046","full_name":"elennick/reversi","owner":"elennick","description":"programming challenge for Three Rings interview in 2014","archived":false,"fork":false,"pushed_at":"2019-10-11T22:06:14.000Z","size":209,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T13:33:19.821Z","etag":null,"topics":["interview","playn","threerings"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elennick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-07T22:55:45.000Z","updated_at":"2019-10-11T22:06:16.000Z","dependencies_parsed_at":"2022-08-22T10:51:10.788Z","dependency_job_id":null,"html_url":"https://github.com/elennick/reversi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elennick%2Freversi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elennick%2Freversi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elennick%2Freversi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elennick%2Freversi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elennick","download_url":"https://codeload.github.com/elennick/reversi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244173554,"owners_count":20410300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["interview","playn","threerings"],"created_at":"2024-11-24T12:14:08.033Z","updated_at":"2025-03-18T07:12:15.012Z","avatar_url":"https://github.com/elennick.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\"mvn clean test\" from the top level to run\n\nrequires java 7 (or more recent)\nrequires maven 3\n\nrequirements that were provided from three rings for this \"programming challenge\":\n\n\u003e The programming challenge is to use one of our game frameworks to\ncreate a simple game of your choice. The framework we'd like you to\nuse is called PlayN (http://code.google.com/p/playn/). It's a Java 2D\nscene graph framework that's pretty similar to Flash's 2D scene graph\n(it's even more similar to Starling, a 2D scene graph for Flash that's\nbuilt using Flash's accelerated 3D support).\n\u003e \n\u003e You can make any game you like. If you have some simple game you think\nwould be fun to implement, go ahead. Otherwise something like Reversi\nis a good combination of simple, light on graphics, and involving\nenough game logic to make things interesting (calculating legal moves\nand computing which tiles are flipped when a player makes a play). If\nyou choose a multiplayer game, you can just assume \"hotseat\" play\n(both players at the same computer), you don't have to do networking\nor anything like that.\n\u003e \n\u003e We're looking for something you can do in two or three, two or three\nhour sessions. The first session you'll probably spend getting things\nset up and poking around with some examples and getting your own\nhello-world bits running. The second and possibly third session would\nbe spent writing the game. If you run into any roadblocks along the\nway, you can email me ([REDACTED]@threerings.net). We're most interested in seeing your\ncode and how you choose to represent game state and handle user interaction and\ncompute game logic. We're not trying to find out how good you are at\ndebugging development environment problems. \n\u003e \n\u003e To get started, you'll need the following things:\n\u003e \n\u003e 1. A JDK: http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u4-downloads-1591156.html\n\u003e 2. Maven 3 (a Java build tool): http://maven.apache.org/download.html\n\u003e 3. Git: http://git-scm.com/\n\u003e \n\u003e Check out the PlayN sample projects repository:\n\u003e \n\u003e git clone https://code.google.com/p/playn-samples/\n\u003e \n\u003e Run the hello world sample:\n\u003e \n\u003e cd playn-samples/hello\n\u003e mvn test\n\u003e \n\u003e You should see a window pop up with a rainbow background, and when you\nclick it, a little rotating pea should appear where you clicked.\n\n\u003e Assuming that went well, generate your own skeleton project:\n\n\u003e mvn archetype:generate -DarchetypeGroupId=com.googlecode.playn \\\n-DarchetypeArtifactId=playn-archetype -DarchetypeVersion=1.4\n\n\u003e This will ask you some questions:\n\n\u003e Define value for property 'groupId': :\n\u003e Define value for property 'artifactId': :\n\u003e Define value for property 'version': 1.0-SNAPSHOT: :\n\u003e Define value for property 'package': foobar: :\n\u003e Define value for property 'JavaGameClassName': :\n\n    groupId is generally a reverse domain name (like com.threerings)\n    artifactId is the name of your project (e.g. reversi)\n    version you can leave at 1.0-SNAPSHOT, it doesn't matter\n    package will default to your groupId and is the Java package that\n    will be used for the skeleton project\n    JavaGameClassName will be the name of the main class in your project\n    and used as a prefix for other class names (e.g. Reversi)\n\n\u003e Once you enter those things in, a skeleton game project will be\n\u003e generated in a directory named by your artifactId. Assuming we use the\n\u003e following values:\n\n\u003e Define value for property 'groupId': : com.threerings.challenge\n\u003e Define value for property 'artifactId': : reversi\n\u003e Define value for property 'version': 1.0-SNAPSHOT: :\n\u003e Define value for property 'package': com.threerings.challenge: :\n\u003e Define value for property 'JavaGameClassName': : Reversi\n\u003e Confirm properties configuration:\n\u003e groupId: com.threerings.challenge\n\u003e artifactId: reversi\n\u003e version: 1.0-SNAPSHOT\n\u003e package: com.threerings.challenge\n\u003e JavaGameClassName: Reversi\n\u003e Y: : y\n\n\u003e You will end up with a directory structure as follows:\n\n\u003e reversi/build.xml\n\u003e reversi/core/pom.xml\n\u003e reversi/core/src/main/java/com/threerings/challenge/core/Reversi.java\n\u003e reversi/core/src/main/java/com/threerings/challenge/resources/images/bg.png\n\u003e reversi/java/pom.xml\n\u003e reversi/java/src/main/java/com/threerings/challenge/java/ReversiJava.java\n\u003e reversi/pom.xml\n\u003e reversi/android/...\n\u003e reversi/html/...\n\u003e reversi/ios/...\n\n\u003e The android, html, and ios directories can be ignored. PlayN is a\ncross platform toolkit, but you will just work with the desktop Java\nbackend. The files in core/ are where your main game code lives.\nReversi.java is the skeleton game code, and resources/images/bg.png is\nan image that's included as part of the skeleton game.\nReversiJava.java is the Java backend bootstrap file, you shouldn't\nhave to change it.\n\n\u003e The first thing you'll want to do is to disable the other platform\nbackends. Edit reversi/pom.xml and remove the following lines:\n\n\u003e \u003cmodule\u003ehtml\u003c/module\u003e\n\u003e \u003cmodule\u003eandroid\u003c/module\u003e\n\u003e \u003cmodule\u003eios\u003c/module\u003e\n\n\u003e Then you should be able to run your skeleton game:\n\n\u003e cd reversi\n\u003e mvn test\n\n\u003e You should see a rainbow background (but no peas when you click). If\nyou make it this far without a hitch, then you're off to the races.\nLook at the code in playn-samples/showcase/core for examples of how to\ndo a bunch of standard stuff in PlayN (like creating images and\ndrawing into them, loading images form files, displaying images on\nscreen in layers, listening for mouse clicks, and so forth).\n\n\u003e You are also welcome to use Eclipse. Once you've followed the steps\nabove, you can import the reversi directory into Eclipse. If you\nimport using \"Maven -\u003e Existing Maven Projects\" then Eclipse will\nautomatically set up the dependencies between the core and java\nsubmodules and set up dependencies on the PlayN library. If you're not\nfamiliar with Eclipse, I wouldn't recommend going this route. Just use\nyour favorite text editor and compile and run your game using \"mvn\ntest\".\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felennick%2Freversi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felennick%2Freversi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felennick%2Freversi/lists"}