Skip to content

Instantly share code, notes, and snippets.

View aneveux's full-sized avatar
🐝
ʕノ•ᴥ•ʔノ ︵ ┻━┻

Antoine Neveux aneveux

🐝
ʕノ•ᴥ•ʔノ ︵ ┻━┻
View GitHub Profile
@aneveux
aneveux / LCEB.java
Created April 2, 2013 12:53
Simple Java code written during a Live Coding session (~30min.) solving the "Compte est bon" game, which aims at finding all the operations to apply to a list of numbers to get an expected result. Warning: this source code is not optimized, and could be better, but the goal was to write it quickly in some kind of competition ;)
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class LCEB {
public List<String> resolve(final List<Integer> numbers,
final Integer expected) {
return getSolutions(expected, numbers, null, null);
}
@aneveux
aneveux / SoundPlayer.java
Created May 9, 2012 08:19
This class allows to play a *.wav sound in a particular thread
import java.io.IOException;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.LineEvent;
import javax.sound.sampled.LineEvent.Type;
import javax.sound.sampled.LineListener;
import javax.sound.sampled.LineUnavailableException;
@aneveux
aneveux / jachievement_example_1.java
Created May 7, 2012 09:42
Simple notifications using JAchievement
Achievement achievement = new Achievement("Achievement unlocked", "My first Java code.");
AchievementQueue queue = new AchievementQueue();
queue.add(achievement);