Giter Site home page Giter Site logo

juliatris's Introduction

JuliaTris

Copyright (C) 2021 J. Férard https://github.com/jferard

A Tetris clone in Julia/Qt under GPLv3

Summary

I wanted to learn a bit of Julia and a bit of Qt. So I wrote this little Tetris clone.

$ julia --project src/JuliaTris.jl 

Screenshot:

JuliaTris

Game

I added two modes to the classic "Type A" (unlimited) and "Type B" (25 lines) modes:

  • "Touch ground": one tetromino must touch the ground despite the garbage blocks present at the beginning
  • "Cleaner": same as "Touch ground", but the game ends when the height is less or equal to one.

About Julia

I won't write another blog post about Julia. Just a few remarks (this is my first program in Julia):

  • arrays and matrix starting at 1 are not a gift you want to place a tertromino on the game board. If tetromino_start_x is the x of the tetromino and cur_x the pos of the current block inside the tetromino, then block_x = tetromino_start_x + cur_x - 1 (in any other language: block_x = tetromino_start_x + cur_x).
  • I was suprised by the amount of runtime errors. My IDE (IntelliJ) did not provide warnings about thing as simple as the incorrect number of call arguments. Hence, programming was unusually tedious.
  • Multiple dispatch is really (I mean: really) convenient.

About Qt

Just a one remark (this is my first program in Qt):

  • I didn't know that QML was like JavaScript: there's almost no learning curve.
  • QtQuick was easy to use.

juliatris's People

Contributors

jferard avatar

Watchers

 avatar  avatar

juliatris's Issues

Edge case in board

Step 1:

  xxx
ooooxooo
oo   o o

Step 2 should be:

ooxxxo o

Not:

  xxx  
oo   o o

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.