${PROJECT_NAME}
should be your own project name.
$ gcloud functions deploy helloExec --trigger-http --project=${PROJECT_NAME}
oddEven :: [Int] -> ([Int],[Int]) | |
oddEven [] = ([], []) | |
oddEven (x:xs) | odd x = (x:odds, evens) | |
| otherwise = (odds, x:evens) | |
where (odds, evens) = oddEven xs |
import System.IO | |
import Data.List | |
import System.Random | |
main = do | |
gen <- getStdGen | |
let answer = take 4 (randomRs ('1', '4') gen) | |
putStrLn "Hello, guess the number!" | |
guessNumber answer |
import Control.Applicative | |
import Data.List | |
import System.Random | |
-- XとYと爆弾の数(TODO: 決め打ちしない) | |
maxX :: Int | |
maxX = 9 | |
maxY :: Int | |
maxY = 9 | |
numBoms :: Int |
import Control.Applicative | |
import Data.List | |
import System.Random | |
-- XとYの数(TODO: 決め打ちしない) | |
maxX :: Int | |
maxX = 9 | |
maxY :: Int | |
maxY = 9 |
import Control.Applicative | |
import Data.List | |
import System.Random | |
-- XとYの数(TODO: 決め打ちしない) | |
maxX :: Int | |
maxX = 9 | |
maxY :: Int | |
maxY = 9 |
import Control.Monad.State | |
type Point = (Int, Int) | |
move :: Char -> State Point () | |
move 'u' = do (x,y) <- get; put (x, y-1) -- 上へ移動 | |
move 'd' = do (x,y) <- get; put (x, y+1) -- 下へ移動 | |
move 'l' = do (x,y) <- get; put (x-1, y) -- 左へ移動 | |
move 'r' = do (x,y) <- get; put (x+1, y) -- 右へ移動 |
import Data.List | |
import System.Environment | |
import Data.Maybe | |
import Control.Monad.Reader | |
type Env = [(String, String)] | |
environment :: Env | |
environment = | |
[ ("HOME", "/home/haskell") |
It can be checked by the same method of Google Cloud Functions
$ mvn appengine:deploy
https://twitter.com/sonatard/status/1002767157262872577
グローバル領域のポインタ比較は定数化されている。
$ go build -gcflags '-N -l' -o executable .
$ go tool objdump -s isEqual executable
TEXT main.isEqual(SB) /Users/apstndb/work/gosandbox/main.go
main.go:7 0x10935b0 c644240800 MOVB $0x0, 0x8(SP)
main.go:8 0x10935b5 c644240800 MOVB $0x0, 0x8(SP)