Skip to content

Instantly share code, notes, and snippets.

import dom
type
Canvas* = ref CanvasObj
CanvasObj {.importc.} = object of dom.Element
CanvasContext2d* = ref CanvasContext2dObj
CanvasContext2dObj {.importc.} = object
font*: cstring
globalAlpha*: float
-- JSON correspondant (à parser) :
-- {
-- "keywords": [
-- { "uid": 6, "url": "...", "keyword": "..." },
-- { "uid": 55, "url": "...", "keyword": "..." },
-- { "uid": 462, "url": "...", "keyword": "..." }
-- ],
--
-- "records": {
-- UN_TIMESTAMP: [
#
# Portage pur
#
type
lhMutex = object
id: int64
lhWindow = object
id: int64
x: int
import tables
type
GroupName = enum
None
Purple
LightBlue
Pink
Orange
Red
import Array
import String
import Html.App as Html
import Json.Decode as Json
import Array exposing (Array)
import Html.Events exposing (keyCode, on, onClick, onInput, targetValue)
import Html exposing (..)
###
const map = [
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ],
[ 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ],
[ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ],
[ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ],
[ 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ],
[ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ],
[ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ],
[ 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ],
shopt -s globstar
skewc src/**/*.sk --output-file=app.js --target=js --message-limit=0
class Point {
var x double
var y double
}
namespace Game {
const GRID = 16
var hero Entity
}
class Vector2D {
var x double
var y double
def new {
self.x = 0
self.y = 0
}
def new(x double, y double) {
@PifyZ
PifyZ / exolundi3.tcl
Last active April 5, 2016 06:15
Exercice du lundi n°3 : Checkeur de Blackjack
# ---------
# Fonctions
# ---------
# Récupérer une valeur au hasard dans une liste
proc random_pick { a_list } {
lindex $a_list [ expr { int(rand() * [ llength $a_list ]) } ]
}
# Donner la valeur d'une carte
proc card_value { card } {