Skip to content

MathieuSoysal/CodinGame-Puzzles-stats-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maven Central Coverage Maintainability Rating GitHub Actions Javadoc

CodinGame Puzzles stats library GitHub

Simple library for interacting with CodinGame's puzzle API.

How to integrate the CodinGame-Puzzles-Stats-library into your code

Required Java version : 17

Maven

If you have Maven, add the following to the dependencies of your pom.xml file:

<dependency>
  <groupId>io.github.mathieusoysal</groupId>
  <artifactId>codingame-puzzles-stats</artifactId>
  <version>1.0.5</version>
</dependency>

See an example of a pom.xml file with the CodinGame-Puzzles-stats-library

Gradle

If you are using Gradle, add the following to the dependencies of your build.gradle file:

    implementation 'io.github.mathieusoysal:codingame-puzzles-stats:1.0.5'

Example code for using the CodinGame-Puzzles-Stats library

import com.github.mathieusoysal.codingame_stats.puzzle.Puzzle;
import com.github.mathieusoysal.codingame_stats.puzzle.achievement.Achievement;
import com.github.mathieusoysal.codingame_stats.puzzle.topic.Topic;
import com.github.mathieusoysal.codingame_stats.CodinGame;

public class CodeExemple {

    public static void main(String[] args) {
        CodinGame codinGame = new CodinGame();

        // Get all puzzles of CodinGame
        List<Puzzle> puzzles = codinGame.getPuzzles();

        // Iterate over all puzzles
        for (Puzzle puzzle : puzzles) {
            // Print the title of the puzzle
            System.out.println(puzzle.getTitle());

            // Print the solved count of the puzzle
            System.out.println(puzzle.getSolvedcount());

            // Print the attempt count of the puzzle
            System.out.println(puzzle.getAttemptCount());

            // Print the achievement count of the puzzle
            System.out.println(puzzle.getAchievementCount());

            // Print the xp points of the puzzle
            System.out.println(puzzle.getXpPoints());

            // Print the created date of the puzzle
            System.out.println(puzzle.getCreatedDate());

            // Print the title of the puzzle
            System.out.println(puzzle.getTitle());

            // Print the contributor of the puzzle
            System.out.println(puzzle.getContributor());

            // Print the topics of the puzzle
            for (Topic topic : puzzle.getTopics()) {
                System.out.println(topic.getHandle());
                System.out.println(topic.getValue());
            }

            // Print the achievements of the puzzle
            for (Achievement achievement : puzzle.getLinkedAchievements()) {
                System.out.println(achievement.getTitle());
                System.out.println(achievement.getDescription());
                System.out.println(achievement.getPoints());
                System.out.println(achievement.getLevel());
            }

        }

    }
}

See more code exemples

Contribution

Suggestions and contributions are always welcome! Please discuss larger changes via an issue before submitting a request.

Licence

This project is released under the GNU General Public License v3.0