This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Méthode d'affichage du labyrinthe. | |
public void paintComponent(Graphics g) { | |
Graphics2D g2 = (Graphics2D) g; | |
for (int i = laby.getHero().cell.getI()-VIEW_FIELD; i <= laby.getHero().cell.getI()+VIEW_FIELD; i++) { | |
for (int j = laby.getHero().cell.getJ()-VIEW_FIELD; j <= laby.getHero().cell.getJ()+VIEW_FIELD; j++) { | |
Cell cell = laby.get(i, j); | |
if (cell == null) { | |
continue; | |
} | |
cell.paintCell(g2, (j-laby.getHero().cell.getJ()+VIEW_FIELD)*SCALE, (i-laby.getHero().cell.getI()+VIEW_FIELD)*SCALE, SCALE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Wololo Javascript | |
* By Théophile Walter | |
* | |
*/ | |
// Starts the Wololo | |
wololo_init(); | |
// Setting up some datas |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Comic Sans Killer | |
// @namespace tw.walter.comicsanskiller | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
/* | |
* Comic Sans Killer | |
* by Théophile Walter | |
* https://walter.tw |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Compile with '-rectypes' option *) | |
let delta x = | |
if x mod 2 = 0 then x / 2 | |
else 3*x + 1 in | |
let syr s x = | |
Printf.printf "%d " x; | |
if x <= 1 then () | |
else s s (delta x) in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Open the big integer module, requires to compilate with "nums.cma" *) | |
open Big_int;; | |
(* Get the value as a big_int *) | |
let n = big_int_of_string Sys.argv.(1) in | |
(* Set up some big_int that we need use *) | |
let bi1 = big_int_of_int 1 in | |
(* The function *) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <netdb.h> | |
void error(const char *msg) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Excuses SNCF | |
# Les genres | |
M = 0 | |
F = 1 | |
# Les mots | |
sujet = ['Le traffic ', 'La circulation des trains ', 'Le fonctionnement de la ligne ', 'L\'horaire du prochain train '] | |
sujet_genre = [M, F, M, M] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fizzbuzz(N): | |
vfb = ['Fizz', '', ''][N%3] + ['Buzz', '', '', '', ''][N%5] | |
return vfb + (str(N)[len(vfb)*len(str(N)):]) | |
import unittest | |
class TestFizzBuzz(unittest.TestCase): | |
def test_fizzbuzz(self): | |
for i in range(9999999): |