You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
releases 140bytes Music SoftSynth 13 October 2011 140bytes softsynth music sound javascript audio HTML5 This year has kept people busy crafting little things. It started on May 23, 2011 when Jed Schmidt created the 140byt.es master GIST thus throwing the ball for a tweet-sized, fork-to-play, community-curated collection of JavaScript. Later, on September 26, 2011 Viznut released the Experimental m
1.7になったので,久々の続編。 for(i=0,s="string to iterate";c=s[i++];)print(c) /* ↓ */ for(i in s="string to iterate")print(c=s[i]) // IE・Rhinoでは不可能な操作(なので盲点だった)。 // SpiderMonkey専用? (4) /* ↓ */ for([i,c]in"string to iterate")print(c) // 1.8では使えなくなるらしいので今のうち。(9) for([,c]in"string to iterate")print(c) // 分割代入の左辺は省略も可能。for eachは用無し。(10) r=[];for(k in d)r.push(k) /* ↓ */ r=[i=0];for(r[i++]in d); // 「JavaScript第五版
d[k]=++d[k]||1 // d[k] = d[k] ? d[k]+1 : 1 // ↓ // d[k]=-~d[k] // ~undefined === -1 を利用。uniqもcountも無いので割とよく使う。(3) [x,y]=['123','456'],print(+x+ +y) // ↓ // [x,y]=['123','456'],print(x- -y) // 数値としての和が欲しい場合。(1) 余談 悲しいことに,入力の終わりを検出できないバグ(?)は健在*1。 最新版ではちゃんと直っている。 $ cat test hoge fuga piyo $ js -v JavaScript-C 1.8.0 pre-release 1 2007-10-03 usage: js [-zKPswWxCi] [-b branchlimit] [-c stackchunksize] [
11月1日の日記(http://d.hatena.ne.jp/Ozy/20071101#p1)で,7行テトリスの作者が,超絶ショートコーダーのnanagyouさんであるということがわかりました.現在はもっと短縮されているようです. http://www.geocities.jp/nanagyou/list.html nanagyouさん(http://geocities.yahoo.co.jp/gl/nanagyou/)は,ショートコーディング本にも名を刻んでいるスーパーコーダーであります.先日,私が悩んでいたブロック回転の計算についても解決されていますし,document.bodyも変数を使って上手く短縮しています.何より無駄なif文が省かれて構造的にはより洗練されたものになっています.スバラシイ… で,nanagyouさんのコードを見てて思ったのですが,変数eって単にウェイトをかけてる
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く