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
(ql:quickload :cl-glut) | |
(defclass main-window (glut:window) | |
() | |
(:default-initargs :pos-x 100 :pos-y 100 :width 320 :height 240 :title "hello opengl" | |
:mode '(:single :rgba))) | |
(defmethod glut:display-window :before ((w main-window)) | |
(gl:clear-color 1 1 1 1)) |
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
(ql:quickload '(:trivia.level2 :serapeum :trivia.ppcre :alexandria) :silent t) | |
(in-package :cl-user) | |
(defpackage :malgo | |
(:use :cl :trivia.level2 :trivia.ppcre) | |
(:export :parse)) | |
(in-package :malgo) | |
(alexandria:define-constant +number-re+ "^(\\+|\\-|)([0-9]+(?:\\.[0-9]+|))" :test #'string=) | |
(alexandria:define-constant +number-without-sign-re+ "^([0-9]+(?:\\.[0-9]+|))" :test #'string=) |
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
(defparameter *board* | |
(list #\_ #\_ #\_ | |
#\_ #\_ #\_ | |
#\_ #\_ #\_)) | |
(defun show-board (board) | |
(format t " 012~%") | |
(format t "0 ~{~a~}~%" (subseq board 0 3)) | |
(format t "1 ~{~a~}~%" (subseq board 3 6)) | |
(format t "2 ~{~a~}~%" (subseq board 6 9))) |
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
#include <stdio.h> | |
int main(void) { | |
char* flag = "FLAG{hello_world}"; | |
puts("hello"); | |
return 0; | |
} |
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
#include <stdio.h> | |
int main(void) { | |
char flag[12]; | |
flag[0] = 'F'; | |
flag[1] = 'L'; | |
flag[2] = 'A'; | |
flag[3] = 'G'; | |
flag[4] = '{'; | |
flag[5] = 'h'; |
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
use std::io::{self, Read, stdin}; | |
use std::collections::HashMap; | |
#[derive(Debug)] | |
struct BFM { | |
program: String, | |
tape: Vec<i32>, | |
ip: usize, | |
dp: usize, | |
braces: HashMap<usize, usize>, |
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
Theorem p : forall (A : Type) | |
(b : bool) | |
(x : A), | |
(if b then x else x) = x. | |
Proof. | |
intros A b x. | |
destruct b. | |
- reflexivity. | |
- reflexivity. | |
Qed. |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <limits.h> | |
#define EMPTY 0 | |
#define BLACK 1 | |
#define WHITE 2 | |
#define OUTER 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
data T = A | B | C T | |
deriving (Show, Eq) | |
class HasT a where | |
t :: a -> T | |
instance HasT T where | |
t = id | |
instance HasT a => HasT (Maybe a) where |
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
(* 普通の再帰で書いたfibと、末尾再帰のfibが等しいことをCoqで証明 | |
http://www.madsbuch.com/blog/100-days-of-fibonacci-day-7-coq/ | |
を参考にした。 | |
*) | |
From mathcomp Require Import ssreflect.all_ssreflect. | |
Fixpoint fib1 (n : nat) : nat := | |
match n with | |
| 0 => 0 | |
| 1 => 1 |