Skip to content

Instantly share code, notes, and snippets.

View snwfdhmp's full-sized avatar

Martin snwfdhmp

View GitHub Profile
@snwfdhmp
snwfdhmp / codeleandre.c
Created December 29, 2016 18:53
Code "corrigé"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 80
typedef char tchaine[MAX];
char *lire(char *chaine)
{
@snwfdhmp
snwfdhmp / ImageManipulator.php
Created May 6, 2017 12:09
Image manipulation class, provides cropping, resampling and canvas resize
<?php
class ImageManipulator
{
/**
* @var int
*/
protected $width;
/**
* @var int
@snwfdhmp
snwfdhmp / animated_bg.html
Last active September 2, 2022 16:13
Animated background (credits : jack@greensock.com (more: see sources))
<!-- PLEASE GO TO LINE 10 FOR CREDITS -->
<div id='animated-background' class='animated-background'>
<canvas id='animated-background-canvas'></canvas>
</div>
<script>
/*!
* @author: Jack Doyle, jack@greensock.com
@snwfdhmp
snwfdhmp / Avalam_isOver.c
Created June 4, 2017 10:34
Fonction qui dit si la partie est terminée ou non
//à caser où tu veux
//dépendances : MovePlan, Emplacement
bool isOver(Emplacement grille[TAILLE][TAILLE]) {
MovePlan tmp;
int x,y,k,l;
for (x = 0; x < TAILLE; ++x)
for (y = 0; y < TAILLE; ++y)
if(grille[x][y].valeur == 2)
continue;
#ifndef DISPLAY_H
#define DISPLAY_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <iostream>
#include <vector>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include "classes/Emplacement/Emplacement.class.h"
#include "classes/Mouvement/Mouvement.class.h"
#include "classes/Player/Player.class.h"
#include "classes/Window/Window.class.h"
#include "config/macros.h"
#include "config/constants.h"
@snwfdhmp
snwfdhmp / excavate+useallfuel.lua
Created April 4, 2020 10:58
Minecraft/Buildcraft Mining Turtle: 'excavate' program except it uses all fuel it collects
local tArgs = { ... }
if #tArgs ~= 1 then
print( "Usage: excavate <diameter>" )
return
end
-- Mine in a quarry pattern until we hit something we can't dig
local size = tonumber( tArgs[1] )
if size < 1 then
print( "Excavate diameter must be positive" )
const startingTime = 4324;
function main() {
console.log(data.players[0].state);
for (let i = 0; i < data.players.length; i++) {
updatePlayer(data.players[i], startingTime + 200);
}
console.log(data.players[0].state);
}