Giter VIP home page Giter VIP logo

codescuffle's Introduction

I like learning new programming languages.

Favorites
Julia Crystal Ruby Python Svelte

Currently learning
Haskell Rust Lua RISC-V D-lang Zig

I would like to learn
Clojure Elixir Fortran Fsharp Kotlin Nim Racket

I also know


You can find me on various coding problem sites:

CodinGame | CodeWars | Exercism | Leetcode | code.golf

codescuffle's People

Contributors

andriamanitra avatar swz-git avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

codescuffle's Issues

Implement game rooms (frontend)

The browser side should communicate with the websockets (depends on #4) and update the page as it receives information. Game room ECR also needs to be changed to be able to show information such as players joining/submitting/quitting and game room settings.

Implement game rooms (backend)

Game rooms should be implemented using websocket connections. Clients (web browsers) need to be able to connect to a game room and the game room should provide them all the necessary information to update the view for the users. This includes puzzles, game room settings, results after rounds, and notifications about users joining/quitting.

The websocket communication protocol also needs to be documented.

Implement a Puzzle class

There should be a JSON serializable Puzzle class that can be used to store puzzle instances. The class should be made in the file Puzzle.cr, that already has an example of what the JSON that comes in might look like (at a minimum, more fields will probably be needed).

Creating a Puzzle from JSON should produce an error if

  • Some of the required fields are missing
  • Fields contain values of wrong type
  • Fields that are not supposed to be empty (title for example) contain an empty string
  • There are unrecognized extra fields

Some (or most) of these may be automatically done by including JSON::Serializable, but they should be tested.

Required functionality

  • Verifying the correctness of execution results (results will come in from the API as specified in Piston docs)

Automate running the application

There needs to be an automated way to run website backend, the database, and an instance of Piston/coderunner. The easiest way to achieve this is probably Docker-compose, but other solutions are also possible.

Show a nice results pop-up when round ends

Currently when a round ends the players just get alert() with a link to the results page. This should be changed to be a nice-looking modal window either using iframe or a statically positioned element. There should also be an easy way to share a link to the results page.

Set up a database

The website backend needs a database to store puzzles. A strong candidate for a database management system is Postgres. The database should run inside docker and there needs to be an automated way to initialize the database with the required tables.

Still not decided on whether or not ORM should be used. Options for ORMs in Crystal include:

Implement skipping rounds

This requires
a) some way to vote about whether or not to skip the round
b) some way to clear the (server-side) timeout that currently stops a round. This blog post explains how to use Crystal's select statement which would likely be useful here.

Implement a way to create game rooms

This can be achieved by creating a HTML form in the frontend, and HTTP POST end point in the backend that creates a new game room and redirects the user to it.

Make results page look nice

Currently the results page looks like trash:
image

It should look good. This means doing some css, and adding syntax highlighting (with codemirror or monaco-editor) to the code. The template probably also needs to be modified.

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.