3ã®åæ°ã¨3ãã¤ãæ°åã®ã¨ãã ãã¢ãã«ãªããµã¯ã©ã¨ãã£ã¿ã®ãã¯ã
ãã¯ããããã°ã©ããããã®NabeAtzzåé¡ã¯ãã£ã¦ããããã
åã«æ°åãåºåãããã¤ã¯ããããªäººããã£ã¦ãã®ã§ãèªåã¯ãµã¯ã©ã¨ãã£ã¿ã®ãã¯ãã«ãã¦ã¿ãã
ãã®ãã¯ããå®è¡ããã¨ãã¨ãã£ã¿å ã®ããã¹ãã®ãã¡ã3ã®åæ°ã¨3ãã¤ãæ°åã®ã¨ãã ãã¢ãã«ãªãã
nabeatzz.js
if(Editor.GetSelectedString(0).length == 0) Editor.SelectAll(); var source = Editor.GetSelectedString(0); Number.prototype.has_num = function(n){ if(this == 0) return false; if(this % n == 0) return true; return (function(a, b){ if(a == 0) return false; if(a % 10 == b) return true; return arguments.callee(Math.floor(a / 10), b); })(this, n); }; Number.prototype.to_aho = function(){ var ahonums = [ ['', 'ãã¡', 'ã«', 'ããã', 'ã', 'ã', 'ãã', 'ãã¡', 'ã¯ã¡', 'ãã ã'], ['', 'ãã ã', 'ã«ã¼ãã ', 'ããããã ', 'ããããã ', 'ãããã ', 'ãããã ', 'ãªãªãã ', 'ã¯ã¡ãã ', 'ãã ããã '], ['', 'ã²ãã', 'ã«ã²ãã', 'ããã³ãã', 'ããã²ãã', 'ãã²ãã', 'ãã£ã´ãã', 'ãªãªã²ãã', 'ã¯ã£ã´ãã', 'ãã ãã²ãã'], ['', 'ãã', 'ã«ãã', 'ãããã', 'ãããã', 'ããã', 'ãããã', 'ãªãªãã', 'ã¯ã£ãã', 'ãã ããã'], ['', 'ãã¡ã¾ã', 'ã«ã¾ã', 'ããã¾ã', 'ããã¾ã', 'ãã¾ã', 'ããã¾ã', 'ãªãªã¾ã', 'ã¯ã¡ã¾ã', 'ãã ãã¾ã'] ]; var r = []; var s = this.toString(); if(ahonums.length < s.length) return s; for(var i = 0; i < s.length; i++){ var d = Number(s.charAt(s.length - 1 - i)); r.unshift(ahonums[i][d]); } return r.join(''); }; Editor.InsText(source.replace(/\d+/g, function(m){ var num = Number(m) if(num.has_num(3)) return num.to_aho(); return m; }));
æ°åã¯99999ã¾ã§å¯¾å¿ã
ãã£ãã試ãã¦ã¿ã
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
ä¸è¨ããµã¯ã©ã¨ãã£ã¿ã«å ¥åãããã¯ãå®è¡ã
1 2 ããã 4 5 ãã 7 8 ãã ã 10 11 ãã ãã« ãã ãããã 14 ãã ãã 16 17 ãã ãã¯ã¡ 19 20 ã«ã¼ãã ãã¡ 22 ã«ã¼ãã ããã ã«ã¼ãã ã 25 26 ã«ã¼ãã ãã¡ 28 29 ããããã ããããã ãã¡ ããããã ã« ããããã ããã ããããã ã ããããã ã ããããã ãã ããããã ãã¡ ããããã ã¯ã¡ ããããã ãã ã 40
ãããªãããã¶ãåã£ã¦ãã
ã©ããªææ¸ã«ã§ã使ãã
ã¨ãã£ã¿ã®ãã¯ããªã®ã§ãã©ããªããã¹ãã«ã§ã使ããã
JavaScriptã¯ãããã¹ã±ã¼ãã³ãã¥ãã±ã¼ã·ã§ã³ãºã®Brendan Eichã«ãã£ã¦éçºãããNetscape Navigator 2.0 ã§å®è£ ããããéçºå½åã¯LiveScriptã¨å¼ã°ãã¦ãããã1995å¹´ã«Sun Microsystemsã®éçºããããã°ã©ãã³ã°è¨èªJavaãå½æ大ããªæ³¨ç®ãæµ´ã³ã¦ãããNetscapeã¨Sun Microsystemsãæè¡ææºãã¦ããäºããã£ãçºãJavaScriptã¨ããååã«å¤æ´ãããã1996å¹´ã«ãã¤ã¯ãã½ããã®Internet Explorer3.0ã«æè¼ãããããã«ãªãã¨ããã®æ軽ãããJavaScriptã¯æ¥éã«æ®åãã¦ããã1997å¹´ãéä¿¡ã«é¢ããæ¨æºãçå®ããå½éå£ä½Ecma Internationalã«ãã£ã¦ JavaScript ã®ä¸æ ¸çãªä»æ§ãECMAScriptã¨ãã¦æ¨æºåãã (ECMA 262, ISO/IEC 16262, JIS X 3060)ãå¤ãã® Webãã©ã¦ã¶ã§å©ç¨ã§ããããã«ãªã£ãããããã¹ã±ã¼ã社ã¯ãèªç¤¾ãµã¼ã製åã§ãWEBã¢ããªã±ã¼ã·ã§ã³éçºè¨èªã¨ãã¦ã®å®è£ ãè¡ã£ããããã¡ãã¯ä½ãæ®åããªãã£ãã
JavaScript - Wikipedia
ä¸è¨ã®æç« ããµã¯ã©ã¨ãã£ã¿ã«å ¥åãã¦ããã¯ããå®è¡ã
JavaScriptã¯ãããã¹ã±ã¼ãã³ãã¥ãã±ã¼ã·ã§ã³ãºã®Brendan Eichã«ãã£ã¦éçºãããNetscape Navigator 2.0 ã§å®è£ ããããéçºå½åã¯LiveScriptã¨å¼ã°ãã¦ãããããããã ãã²ãããã ããã ãå¹´ã«Sun Microsystemsã®éçºããããã°ã©ãã³ã°è¨èªJavaãå½æ大ããªæ³¨ç®ãæµ´ã³ã¦ãããNetscapeã¨Sun Microsystemsãæè¡ææºãã¦ããäºããã£ãçºãJavaScriptã¨ããååã«å¤æ´ãããã1996å¹´ã«ãã¤ã¯ãã½ããã®Internet Explorerããã.0ã«æè¼ãããããã«ãªãã¨ããã®æ軽ãããJavaScriptã¯æ¥éã«æ®åãã¦ããã1997å¹´ãéä¿¡ã«é¢ããæ¨æºãçå®ããå½éå£ä½Ecma Internationalã«ãã£ã¦ JavaScript ã®ä¸æ ¸çãªä»æ§ãECMAScriptã¨ãã¦æ¨æºåãã (ECMA 262, ISO/IEC 16262, JIS X ãããããããã )ãå¤ãã® Webãã©ã¦ã¶ã§å©ç¨ã§ããããã«ãªã£ãããããã¹ã±ã¼ã社ã¯ãèªç¤¾ãµã¼ã製åã§ãWEBã¢ããªã±ã¼ã·ã§ã³éçºè¨èªã¨ãã¦ã®å®è£ ãè¡ã£ããããã¡ãã¯ä½ãæ®åããªãã£ãã
ãããªã£ãããInternet Explorerããã.0ãã¨ãã¢ãã wwww
ä½ã£ã¦ã¿ãææ³
ãããã£ã¦ã¿ãã¨ãããããã¨JavaScriptã®å¤§äºãªã¨ãããè©°ã¾ã£ãã³ã¼ãã«ãªã£ãã
- prototypeã«ã¡ã½ãããæ¡å¼µ
- 3ãã¤ãæ°åã調ã¹ãããã«å帰
- é åã®é åã使ã£ã¦æ°åãã¢ãã«å¤æ
- String#replaceã®ç¬¬2å¼æ°ã«å¿åé¢æ°ã渡ã
JavaScriptå ¥éã«ã¯ã¡ããã©ããã