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
var _ = require("./lib/underscore-min.js"); | |
exports.Ball = function(i, w){ | |
return {i: i, w: w}; | |
}; | |
exports.solve = function(balls){ | |
// 3, 3, 2ずつ取り出して比べる | |
var right = balls.slice(0, 3); |
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
package yhpg11; | |
public class BitamidaEx { | |
enum Direction { | |
right { | |
@Override | |
int move(int row, int x) { | |
for (int i = x; i < 9; i++) { | |
if (BitamidaEx.is(row, i) == false) { |
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 static org.junit.Assert.assertEquals; | |
import org.junit.Test; | |
enum Masu { | |
A("BCDEFG"), B("HICAGS"), C("IJKDAB"), D("CKLMEA"), E("ADMNOF"), F("GAEOPQ"), G( | |
"SBAFQR"), H("TUIBSk"), I("UVJCBH"), J("VWXKCI"), K("JXYLDC"), L( | |
"KYZaMD"), M("DLabNE"), N("EMbcdO"), O("FENdeP"), P("QFOefg"), Q( | |
"RGFPgh"), R("jSGQhi"), S("kHBGRj"), T("!!UHk!"), U("!!VIHT"), V( |
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
package sample10; | |
import static org.junit.Assert.assertEquals; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.HashSet; | |
import java.util.List; | |
import java.util.Set; |
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
var parse_url = /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/; | |
var url = "http://www.ora.com:80/goodparts?q#fragment"; | |
var result = parse_url.exec(url); | |
var names = ['url', 'scheme', 'slash', 'host', 'port', 'path', 'query', 'hash']; | |
var blanks = ' '; | |
var i; |
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
// parse URI | |
exports.parse_url = /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/; | |
exports.names = ['url', 'scheme', 'slash', 'host', 'port', 'path', 'query', 'hash']; | |
exports.blanks = '@'; | |
// parse number | |
exports.parse_number = /^-?\d+(?:\.\d*)?(?:e[+\-]?\d+)?$/i; |
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 static org.junit.Assert.assertEquals; | |
import org.junit.Test; | |
enum Rule { | |
s { | |
@Override | |
int[] play(int[] count) { | |
count[1] += 1; | |
if (count[1] == 3) { |
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
package yhpg9; | |
import static org.junit.Assert.assertEquals; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Iterator; | |
import java.util.List; | |
import org.junit.Test; |
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
package yhpg9; | |
import static org.junit.Assert.assertEquals; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import org.junit.Test; |
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 static org.junit.Assert.assertEquals; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.HashSet; | |
import java.util.List; | |
import java.util.Set; | |
import org.junit.Test; |