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
;;; ゼルダの伝説 (SFC) で、鍵と扉がそれぞれ n 個のとき、 | |
;;; ダンジョンのとりうる状態数を返す zelda 関数 (仮) | |
(use srfi-1) | |
(define (zelda n) | |
(define (combination n m) | |
(/ (apply * (iota m (+ (- n m) 1) 1)) | |
(apply * (iota m 1 1)))) | |
(define (sum list) |
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
*~ | |
*.6 | |
*.8 | |
gomaze |
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 main | |
import ( | |
"fmt" | |
) | |
func main() { | |
a := [...][4]int{ | |
[...]int{1,2,3,4}, | |
[...]int{1,2,3,4}, |
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
$ gcc-mp-4.5 -o test -std=c++0x -L/opt/local/lib test.cpp | |
Undefined symbols: | |
"operator new(unsigned long)", referenced from: | |
std::_Function_base::_Base_manager<main::{lambda()#1}>::_M_clone(std::_Any_data&, std::_Function_base::_Base_manager<main::{lambda()#1}> const&, std::integral_constant<bool, false>) in ccBk7Dwv.o | |
std::_Function_base::_Base_manager<main::{lambda()#1}>::_M_init_functor(std::_Any_data&, {lambda()#1}&&, std::integral_constant<bool, false>) in ccBk7Dwv.o | |
"std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)", referenced from: | |
main::{lambda()#1}::operator()() const in ccBk7Dwv.o | |
"std::ios_base::Init::Init()", referenced from: | |
__static_initialization_and_destruction_0(int, int) in ccBk7Dwv.o | |
"operator delete(void*)", referenced from: |
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 <iostream> | |
#include <boost/range.hpp> | |
class foo { | |
private: | |
int values_[10]; | |
public: | |
typedef decltype(values_) values_type; | |
foo() | |
: values_{3, 1, 4, 1, 5, 9, 2, 6, 5, 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
#include <algorithm> | |
#include <iostream> | |
#include <boost/range.hpp> | |
template<class Values> | |
int foo(Values values) { | |
std::for_each(boost::begin(value), boost::end(values), [](int& value) { | |
std::cout << value << std::endl; | |
}); | |
} |
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
(1..?d).each{|i|puts i%15>0?i%5>0?i%3>0?i:'Fizz':'Buzz':'FizzBuzz'} |
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 Blaze.ByteString.Builder (fromByteString) | |
import Data.CaseInsensitive (mk) | |
import qualified Data.ByteString.Char8 as C8 | |
import qualified Data.ByteString.UTF8 as U8 | |
import Network.HTTP.Types | |
import Network.Wai | |
import Network.Wai.Handler.Warp (run) | |
myApp :: Application | |
myApp _ = do |
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 Data.List | |
import Data.Maybe | |
main :: IO () | |
main = do | |
putStrLn $ show $ head solves | |
solves :: [[[Int]]] | |
solves = [state | | |
state <- initStates 3 5, |
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
main :: IO () | |
main = print $ map fizzBuzz [1..] | |
fizzBuzz :: Integer -> String | |
fizzBuzz n | |
| n `rem` 15 == 0 = "FizzBuzz" | |
| n `rem` 3 == 0 = "Fizz" | |
| n `rem` 5 == 0 = "Buzz" | |
| otherwise = show n |
OlderNewer