Skip to content

Instantly share code, notes, and snippets.

View snwfdhmp's full-sized avatar

Martin snwfdhmp

View GitHub Profile
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);
}
@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" )
#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"
#ifndef DISPLAY_H
#define DISPLAY_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <iostream>
#include <vector>
@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;
@snwfdhmp
snwfdhmp / animated_bg.html
Last active September 2, 2022 16:13
Animated background (credits : [email protected] (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, [email protected]
@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 / 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)
{