This file contains hidden or 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
| git clone git://github.com/jeantil/kata.git | |
| git checkout -b {local_branch} origin/puissance4-20110222 |
This file contains hidden or 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 java.util.Arrays; | |
| import java.util.HashSet; | |
| import java.util.Set; | |
| public class Mastermind { | |
| public int[] solve(String[] guess, String[] secret) { | |
| int bonBienplace = 0; | |
| int bonMalplace = 0; | |
| Set<String> setSecret = new HashSet<String>(Arrays.asList(secret)); |
This file contains hidden or 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
| ; testmastermind.ik | |
| use("ispec") | |
| use("mastermind-kata") | |
| ; Quick reminder how ispec works | |
| ;describe( | |
| ; Object | "method" , | |
| ; it("should be the title of the test", | |
| ; call should == result ? | |
| ; m should not be same(Foo) |
This file contains hidden or 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
| # To change this template, choose Tools | Templates | |
| # and open the template in the editor. | |
| class Arbitre | |
| def initialize | |
| end | |
| def reponse(secret, guess) | |
| c=0 | |
| secret.each_with_index do |e, i| |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Game Of Life</title> | |
| <script src="lib/processing.js"></script> | |
| <script src="gameoflife.js"></script> | |
| <!-- tests --> | |
| <script src="lib/jquery.js"></script> | |
| <script src="test/qunit.js"></script> |
This file contains hidden or 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
| require 'test/unit' | |
| class Solver | |
| def solve(it) | |
| if(it == 12 ) | |
| return [1,4,9,12] | |
| elsif(it >= 9 ) | |
| return [1,4,9] | |
| elsif(it>=4) | |
| return [1,4] |
This file contains hidden or 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
| class Solver | |
| attr_reader :stones | |
| def initialize(heap=0) | |
| @win=false | |
| @stones=heap | |
| end | |
| def user_wins? | |
| @win | |
| end | |
| def play(take) |
This file contains hidden or 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
| package dojo.kata; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.HashSet; | |
| import java.util.List; | |
| import java.util.Set; | |
| import sun.swing.MenuItemLayoutHelper.ColumnAlignment; |
This file contains hidden or 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
| package eu.byjean.bintext; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.net.HttpURLConnection; | |
| import java.net.MalformedURLException; | |
| import java.net.URL; | |
| import javax.servlet.http.HttpServlet; | |
| import javax.servlet.http.HttpServletRequest; |
This file contains hidden or 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
| package eu.bjean | |
| object Mastermind { | |
| def check(secret: Symbol*)(guess: Symbol*): (Int, Int) = { | |
| val (goodPairs,badPairs) = secret.zip(guess).partition({ case (x, y) => x == y }) | |
| var badCount = 0 | |
| if (badPairs.size > 0) { |