Skip to content

Instantly share code, notes, and snippets.

View FlorianCassayre's full-sized avatar

Florian Cassayre FlorianCassayre

View GitHub Profile
public class InfiniteSeries
{
public static void main(String[] args)
{
/*
1 + 2 + 4 + 8 + ... = -1
This algebraic proof is an analogy to Euler's approach to divergent series.
See https://en.wikipedia.org/wiki/1_%2B_2_%2B_4_%2B_8_%2B_%E2%8B%AF
*/
Romèna
Lillinorié
Nouissil
Joaca
Amatavian
Ellan
Lahma
Aurahiba
Hibrelie
Alaine
@FlorianCassayre
FlorianCassayre / MonteCarloEuler.java
Created March 5, 2017 00:50
Probably one of the least efficient way to approximate e.
import java.util.Random;
public class MonteCarloEuler
{
private static final Random random = new Random();
public static void main(String[] args)
{
final int total = 100000;
final int n = 10000;
import java.math.BigInteger;
public final class BigRational extends Number implements Comparable<BigRational>
{
public final static BigRational ZERO = valueOf(0);
public final static BigRational ONE = valueOf(1);
public final static BigRational MINUS_ONE = valueOf(-1);
private BigInteger numerator;
final float g = 0.2;
final float m1 = 1, l1 = 100, m2 = 1, l2 = 100;
float a1 = 0, v1 = 0, x1 = PI / 2;
float a2 = 0, v2 = -0.005, x2 = PI;
float lastX = 0, lastY = 0;
boolean first = true;
PGraphics graphics;
final float g = 0.5, m1 = 1, l1 = 100;
final float i = m1 * l1 * l1 / 3; // m*L^2/3
float a = 0, v = 0.01, x = -PI / 2 + 0.1;
void setup()
{
size(500, 500);
}
void draw()
@FlorianCassayre
FlorianCassayre / gauss_jordan.py
Last active February 9, 2017 18:44
Élimination de Gauss-Jordan en Python
__author__ = 'Florian Cassayre'
from copy import copy, deepcopy
def inverse(toInverse):
size = len(toInverse)
matrix = [[0 for j in range(size * 2)] for i in range(size)] # Matrice n x 2n

Keybase proof

I hereby claim:

  • I am FlorianCassayre on github.
  • I am flomine (https://keybase.io/flomine) on keybase.
  • I have a public key whose fingerprint is F9E9 8023 F31D 58C1 C3E4 6BF6 7C75 C952 059C 1F29

To claim this, I am signing this object:

@FlorianCassayre
FlorianCassayre / RandomFractalGenerator.java
Created August 24, 2016 16:50
Random fractal generator. Customizable & scalable.
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Random;
/**
* Random fractal generator that looks like terrain.
* Since this is just an example, it doesn't keep track of the 'window' location.

Le talent acrobatie s'active quand le joueur fait une chute. Cela lui rapporte de l'expérience et il peut potentiellement amortir ses dégâts au moyen de deux capacités passives.

Cependant, l'acrobatie ne s'active pas lorsque le plugin détecte que le joueur essaie de farmer la capacité. Il n'obtient alors ni expérience, ni roulade (gracieuse).

Les conditions pour que l'acrobatie s'active lors d'une chute sont les suivantes (d'après le code source) (configurables, mais zcraft possède la configuration par défaut) :

  • La chute ne doit pas être mortelle.
  • Ne pas avoir d'enderpearl(s) dans sa main principale lors de la chute. En avoir dans la main secondaire fonctionne cependant.
  • Ne pas être dans un véhicule ou bien chevaucher une entité lors de la chute.
  • Attendre au moins 5 secondes entre chaque chute.