{"id":23338809,"url":"https://github.com/sta-ger/slotify4j","last_synced_at":"2026-03-10T21:33:54.293Z","repository":{"id":96182987,"uuid":"186100585","full_name":"sta-ger/slotify4j","owner":"sta-ger","description":"A server-side video slot game logic framework for Java.","archived":false,"fork":false,"pushed_at":"2020-04-18T13:51:35.000Z","size":311,"stargazers_count":18,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T22:43:43.693Z","etag":null,"topics":["casino","game","game-server","java","return-to-player","rtp","simulation","slot","video-slot"],"latest_commit_sha":null,"homepage":null,"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/sta-ger.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,"governance":null}},"created_at":"2019-05-11T07:15:53.000Z","updated_at":"2024-12-09T09:02:33.000Z","dependencies_parsed_at":"2023-09-24T16:56:48.654Z","dependency_job_id":null,"html_url":"https://github.com/sta-ger/slotify4j","commit_stats":{"total_commits":193,"total_committers":4,"mean_commits":48.25,"dds":"0.23834196891191706","last_synced_commit":"e84d0f43be395303d29f75308104cd0e68c8cf4f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sta-ger/slotify4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sta-ger%2Fslotify4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sta-ger%2Fslotify4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sta-ger%2Fslotify4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sta-ger%2Fslotify4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sta-ger","download_url":"https://codeload.github.com/sta-ger/slotify4j/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sta-ger%2Fslotify4j/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30355747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["casino","game","game-server","java","return-to-player","rtp","simulation","slot","video-slot"],"created_at":"2024-12-21T03:16:53.504Z","updated_at":"2026-03-10T21:33:54.264Z","avatar_url":"https://github.com/sta-ger.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slotify4j\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/924211db7498454d9ff17f62a74f3a23)](https://app.codacy.com/app/sta-ger/slotify4j?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=sta-ger/slotify4j\u0026utm_campaign=Badge_Grade_Dashboard)\n[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/a69e6e98142e484991c57fac795c1100)](https://www.codacy.com/app/sta-ger/slotify4j?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=sta-ger/slotify4j\u0026utm_campaign=Badge_Coverage)\n[![Build Status](https://travis-ci.org/sta-ger/slotify4j.svg?branch=master)](https://travis-ci.org/sta-ger/slotify4j)\n[![Download](https://api.bintray.com/packages/sta-ger/maven/slotify4j/images/download.svg)](https://bintray.com/sta-ger/maven/slotify4j/_latestVersion)\n\nA server-side video slot game logic framework for Java.\n\n[slotify.js](https://github.com/sta-ger/slotify.js) - JavaScript/TypeScript version.\n\n## Usage\n\n### Game Session\n\nSimple casino game logic.\n\n```java\nimport slotify4j.session.*;\n\nimport java.util.Arrays;\n\npublic class Game {\n\n    public static void main(String[] args) {\n        GameSessionConfig config = DefaultGameSessionConfig.builder()\n                .withAvailableBets(new long[]{10, 20, 30})\n                .withCreditsAmount(5000)\n                .build();\n\n        GameSession session = new GameSessionImpl(config);\n        System.out.println(Arrays.toString(session.getAvailableBets())); // [10, 20, 30]\n        System.out.println(session.getBet()); // 10\n        System.out.println(session.getCreditsAmount()); // 5000\n\n        session.setBet(20);\n        System.out.println(session.getBet()); // 20\n\n        try {\n            session.play();\n            System.out.println(session.getCreditsAmount()); // 4980\n        } catch (UnableToPlayException e) {\n            // Not enough credits to play\n        }\n    }\n\n}\n\n\n```\n\nVideo slot game logic.\n\n```java\nimport slotify4j.session.UnableToPlayException;\nimport slotify4j.session.videogames.reelgames.*;\nimport slotify4j.session.videogames.reelgames.reelscontroller.ReelGameSessionReelsControllerImpl;\nimport slotify4j.session.videogames.reelgames.wincalculator.ReelGameSessionWinCalculatorImpl;\n\nimport java.util.Arrays;\n\npublic class Game {\n\n    public static void main(String[] args) {\n        // Create a configuration for 5x4 video slot game with symbols \"A\", \"K\", \"Q\", \"J\", \"10\", \"9\",\n        ReelGameSessionConfig config = new DefaultReelGameSessionConfig()\n                .builder()\n                .withAvailableItems(new String[]{\"A\", \"K\", \"Q\", \"J\", \"10\", \"9\"})\n                .withReelsNumber(5)\n                .withReelsItemsNumber(4)\n                .build();\n        ReelGameSession session = new ReelGameSessionImpl(\n                config, new ReelGameSessionReelsControllerImpl(config), new ReelGameSessionWinCalculatorImpl(config)\n        );\n\n        // Calculated winning amount for 3 symbols \"A\" with bet value of 10 coins\n        System.out.println(session.getPaytable().getWinningAmountForItem(\"A\", 3, 10));\n\n        // Reels number (columns)\n        System.out.println(session.getReelsItemsNumber());\n\n        // Number of items on each reel (rows)\n        System.out.println(session.getReelsNumber());\n\n        // Distributions of symbols on reels (probabilities)\n        Arrays.stream(session.getReelsItemsSequences()).forEach(\n                itemsForReel -\u003e System.out.println(Arrays.toString(itemsForReel))\n        );\n\n        // Play until any winning\n        while (session.getWinningAmount() == 0) {\n            // Play game round\n            try {\n                session.play();\n            } catch (UnableToPlayException e) {\n                // Not enough credits to play\n            }\n        }\n\n\n        // Combination of symbols on reels after play\n        Arrays.stream(session.getReelsItems()).forEach(\n                itemsForReel -\u003e System.out.println(Arrays.toString(itemsForReel))\n        );\n\n        // Total winning amount if there where any winning combinations at last round\n        System.out.println(session.getWinningAmount());\n\n        // Winning lines data\n        session.getWinningLines().forEach((lineId, lineData) -\u003e {\n            // Winning coins amount for line\n            System.out.println(lineData.getWinningAmount());\n\n            // Winning item id\n            System.out.println(lineData.getItemId());\n\n            // X positions of winning items on reels\n            System.out.println(Arrays.toString(lineData.getItemsPositions()));\n\n            // Y positions of winning items on reels\n            System.out.println(Arrays.toString(lineData.getDirection()));\n        });\n\n        // Winning scatter symbols data\n        System.out.println(session.getWinningScatters());\n\n\n    }\n\n}\n```\n\n### Simulation\n\nSimple way to run a lot of game rounds and calculate Return To Player percentage.\n\n```java\nimport slotify4j.session.UnableToPlayException;\nimport slotify4j.session.videogames.reelgames.DefaultReelGameSessionConfig;\nimport slotify4j.session.videogames.reelgames.ReelGameSession;\nimport slotify4j.session.videogames.reelgames.ReelGameSessionConfig;\nimport slotify4j.session.videogames.reelgames.ReelGameSessionImpl;\nimport slotify4j.session.videogames.reelgames.reelscontroller.ReelGameSessionReelsController;\nimport slotify4j.session.videogames.reelgames.reelscontroller.ReelGameSessionReelsControllerImpl;\nimport slotify4j.session.videogames.reelgames.wincalculator.ReelGameSessionWinCalculator;\nimport slotify4j.session.videogames.reelgames.wincalculator.ReelGameSessionWinCalculatorImpl;\nimport slotify4j.simulation.DefaultGameSessionSimulationConfig;\nimport slotify4j.simulation.GameSessionSimulation;\nimport slotify4j.simulation.GameSessionSimulationConfig;\nimport slotify4j.simulation.GameSessionSimulationImpl;\n\npublic class Game {\n\n    public static void main(String[] args) {\n        ReelGameSessionConfig sessionConfig = new DefaultReelGameSessionConfig();\n        sessionConfig.setReelsItemsSequences(new String[][]{\n                {\"J\", \"9\", \"Q\", \"10\", \"A\", \"S\", \"K\"},\n                {\"K\", \"S\", \"10\", \"A\", \"9\", \"Q\", \"J\"},\n                {\"J\", \"Q\", \"10\", \"9\", \"S\", \"A\", \"K\"},\n                {\"Q\", \"10\", \"9\", \"S\", \"K\", \"A\", \"J\"},\n                {\"Q\", \"A\", \"J\", \"10\", \"9\", \"S\", \"K\"},\n        });\n        ReelGameSessionReelsController reelsController = new ReelGameSessionReelsControllerImpl(sessionConfig);\n        ReelGameSessionWinCalculator winningCalculator = new ReelGameSessionWinCalculatorImpl(sessionConfig);\n        ReelGameSession session = new ReelGameSessionImpl(sessionConfig, reelsController, winningCalculator);\n        GameSessionSimulationConfig simulationConfig = new DefaultGameSessionSimulationConfig();\n        simulationConfig.setNumberOfRounds(10000);\n        GameSessionSimulation simulation = new GameSessionSimulationImpl(session, simulationConfig);\n\n        simulation.setBeforePlayCallback(() -\u003e {\n            System.out.println(\"Before play\");\n\n            // Prevent out of credits case\n            session.setCreditsAmount(100000);\n        });\n        simulation.setAfterPlayCallback(() -\u003e System.out.println(\"After play\"));\n        simulation.setOnFinishedCallback(() -\u003e System.out.println(\"Simulation finished\"));\n\n        try {\n            // 10000 rounds will be played\n            simulation.run();\n        } catch (UnableToPlayException e) {\n            // Not enough credits to play\n        }\n\n        // Rtp for current session (about 50-60% with symbols distributions specified earlier at session config)\n        System.out.println(simulation.getRtp());\n\n    }\n\n} \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsta-ger%2Fslotify4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsta-ger%2Fslotify4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsta-ger%2Fslotify4j/lists"}