{"provider_name":"Hatena Blog","author_url":"https://blog.hatena.ne.jp/uehaj/","categories":["Elm","Funcional","Hakell","FunctionalFRP","ArrowizedFRP"],"version":"1.0","blog_url":"https://uehaj.hatenablog.com/","author_name":"uehaj","blog_title":"uehaj's blog ","provider_url":"https://hatena.blog","type":"rich","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fuehaj.hatenablog.com%2Fentry%2F2014%2F07%2F19%2F004359\" title=\"elm\u3067\u3084\u3063\u3066\u307f\u308b\u30b7\u30ea\u30fc\u30ba2: \u25cf\u3092\u5f80\u5fa9\u3055\u305b\u308b - uehaj&#39;s blog \" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","height":"190","width":"100%","title":"elm\u3067\u3084\u3063\u3066\u307f\u308b\u30b7\u30ea\u30fc\u30ba2: \u25cf\u3092\u5f80\u5fa9\u3055\u305b\u308b","image_url":null,"description":"import Window import Debug (log) -- \u65e7\u901f\u5ea6v\u3068\u3001\u73fe\u5728\u4f4d\u7f6ex\u304b\u3089\u3001\u65b0\u3057\u3044\u901f\u5ea6\u3092\u6c42\u3081\u308b\u3002(\u306f\u3058\u3063\u3053\u3060\u3063\u305f\u3089\u901f\u5ea6\u3092\u53cd\u8ee2\u3059\u308b) newv : Int -> Int -> Int newv v x = if (x<= -10 || 10<=x) then -v else v -- \u72b6\u614b\u3092\u8868\u308f\u3059(\u73fe\u5728\u4f4d\u7f6e\u3001\u901f\u5ea6)\u306e\u30bf\u30d7\u30eb\u306b\u5bfe\u3057\u3066\u3001\u6b21\u306e\u72b6\u614b\u3092\u30b7\u30b0\u30ca\u30eb(fps 20)\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u7d2f\u7a4d\u7684\u306b\u8a08\u7b97\u3057\u306a\u304a\u3059\u3068\u3044\u3046\u3053\u3068\u3092\u7e70\u308a\u8fd4\u3059\u3002\u521d\u671f\u72b6\u614b\u306f(0,1)\u3002\u7d50\u679c\u5f97\u3089\u308c\u308b\u306e\u306f\u3001(\u73fe\u5728\u4f4d\u7f6e,\u73fe\u5728\u306e\u901f\u5ea6)\u3092\u8868\u73fe\u3059\u308b\u30b7\u30b0\u30ca\u30eb\u3067\u3042\u308b\u3002 pos = foldp (\\it (x,v) -> let n\u2026","url":"https://uehaj.hatenablog.com/entry/2014/07/19/004359","published":"2014-07-19 00:43:59"}