This file contains 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
from random import shuffle | |
# Il manque forcément des gens | |
participants = ["Ambre", "Arthur", "Théo", "Jeanne", "Gawry", "Antoine", "Océane", "Lisa", "Éloi", "Maëlyse"] | |
cadeau_a = participants.copy() | |
while any(p == c for p, c in zip(participants, cadeau_a)): | |
shuffle(cadeau_a) | |
for p, c in zip(participants, cadeau_a): |
This file contains 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 <stdbool.h> | |
int grille[81] = {0}; | |
void init (FILE * file, int * grille) { | |
for (int i = 0; i<81; i++) { | |
char c = fgetc(file); | |
if (c == '\n') c = fgetc(file); |
This file contains 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
from collections import defaultdict | |
def generer_tableau(mot): | |
d = defaultdict(lambda : -1) | |
for i in range(len(mot)): | |
for j in range(i+1, len(mot)): | |
d[(mot[i], j)] = i | |
return d | |
def boyer_moore(t, m): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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> | |
#define TABSIZE 1000 | |
void print_array(int * array, int size) { | |
for (int i=0; i<size; i++) { | |
printf("%d ", array[i]); | |
} | |
puts(""); |
This file contains 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
{-# LANGUAGE InstanceSigs #-} | |
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} | |
{-# LANGUAGE StrictData #-} | |
module Quine where | |
import Data.Maybe ( fromJust ) | |
-- Propositional calculus | |
data Formula = Top | Bottom | P !Integer | Disjunction !Formula !Formula | Conjunction !Formula !Formula | Negation !Formula |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
import System.Environment | |
import Data.Char | |
execute :: String -> String -> Int -> Int -> IO () | |
execute instructionArray dataArray instructionPointer dataPointer | |
| (instructionPointer < 0 || dataPointer < 0) = fail "Negative index !" | |
| (instructionPointer >= length instructionArray) = return () | |
| otherwise = case (instructionArray !! instructionPointer) of | |
'>' -> execute instructionArray dataArray (instructionPointer+1) (dataPointer+1) | |
'<' -> execute instructionArray dataArray (instructionPointer+1) (dataPointer-1) |
This file contains 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
main: main.c | |
gcc -o $@ $^ `sdl2-config --cflags --libs` |
![benford.png](https://gist.github.com/eloidrai/63f38b5f33732d6e26f6596758dda917/raw/0320f366e9f4ebfdeaf5662e55c92c14cba0f03c/benford.png)
NewerOlder