ドキュメントのタイプを指定
<!-- html5 -->
<!DOCTYPE html>| import std.stdio, | |
| std.typecons; | |
| import player; | |
| enum boardDefault = (function char[8][] (){ | |
| auto ret = new char[8][](8); | |
| foreach(ref line; ret) | |
| foreach(ref cell; line) | |
| cell = '.'; | |
| ret[3][3] = ret[4][4] = 'W'; | |
| ret[3][4] = ret[4][3] = 'B'; |
| Lemma Coq_01 : forall A B C:Prop, (A->B->C) -> (A->B) -> A -> C. | |
| Proof. | |
| intros. | |
| apply H. | |
| apply H1. | |
| apply H0. | |
| apply H1. | |
| Qed. | |
| Lemma Coq_02 : forall A B C:Prop, A /\ (B /\ C) -> (A /\ B) /\ C. |
| s = ARGV[0]; | |
| puts "┏┷┓" | |
| s.each_char do |c| | |
| print "┃", c, "┃" | |
| puts | |
| end | |
| puts "┗━┛" |
| struct CONS(T, U) | |
| { | |
| alias T car; | |
| alias U cdr; | |
| } | |
| unittest | |
| { | |
| alias CONS!(int, CONS!(double, bool)) X; | |
| assert(is(X.car == int)); |
| struct TRUE(T, U) | |
| { | |
| alias T value; | |
| } | |
| struct FALSE(T, U) | |
| { | |
| alias U value; | |
| } | |
| unittest |
| 1 import std.conv, | |
| 2 std.json, | |
| 3 std.stdio, | |
| 4 std.net.curl; | |
| 5 | |
| 6 auto getTemperatureString(in JSONValue temperature) in { | |
| 7 assert(temperature.type == JSON_TYPE.OBJECT); | |
| 8 } body { | |
| 9 if(temperature["max"].type != JSON_TYPE.NULL && temperature["min"].type != JSON_TYPE.NULL) | |
| 10 return "最高気温: " ~ temperature["max"].object["celsius"].str ~ "℃\n" |
| (defn getchar [] | |
| (rand-nth | |
| (sequence "ABCDEFGHIJKLMNOPQRSTUVWXYZ"))) | |
| (defn gen-stap [accum func] | |
| (if (= (func (str (getchar) (getchar) (getchar) (getchar))) "STAP") | |
| accum | |
| (recur (+ accum 1) func))) | |
| (println (gen-stap 1 |
| (define (accum x) | |
| (lambda (i) | |
| (if (= i -1) | |
| x | |
| (accum (+ x i)) | |
| ))) | |
| (define (even>odd? a b c d e) | |
| (if (> ((((((accum | |
| (if (even? a) 1 0)) |
| #include "dijkstra.h" | |
| void dijkstra(int32_t *d, size_t V, Edge *es, size_t E, size_t s) { | |
| const int INF = INT32_MAX; | |
| bool used[V]; | |
| for(size_t i = 0; i < V; i++) { | |
| used[i] = false; | |
| d[i] = INF; | |
| } |