約 3,229,778 件
https://w.atwiki.jp/purkinje/pages/30.html
魔法の効果や毒の効果など、すべての効果を実装した戦闘処理関数を細かく紹介する。 まずは、敵のデータを読み込む関数combat.encounter()を紹介。 枝葉の部分は…… まぬけな百姓とずんぐりとした百姓は、ピップまたは敵の先攻が指定されている。 食屍鬼の生命点は、現在のピップの生命点。 魔女3人は1人ずつの3連戦。連戦中に以前倒した魔女とデータが重ならないようにしたい。 魔女スクロッグは、数に限りのあるドラゴン・ファイア錠を使うのでenemy[Section.subnum].Dragonfire_pillで残り数を管理。 狼は連続2回攻撃できるので、何度目の攻撃かを表すenemy[i].wolf_double_attackを作る。 投げ針という魔法の品は、事前に敵の生命点を半減させる効果があるので実装。 combat.encounter = function (){ var i; enemy_party.exist = true; Pip.quick = 0; enemy_party.quick = 0; combat.turn_num = 0; combat.round = 0; Pip.round_damage = 0; if (Section.num === "46") { //まぬけな百姓 enemy_party.id_num = 1; enemy_party.num = 1; enemy_party.quick = -1; } else if (Section.num === "75") { //まぬけな百姓 enemy_party.id_num = 2; enemy_party.num = 1; enemy_party.quick = -1; } else if (Section.num === "66") { //ずんぐりした百姓 enemy_party.id_num = 3; enemy_party.num = 1; Pip.quick = -1; enemy_party.quick = 10; } else if (Section.num === "83") { //乱暴な百姓 enemy_party.id_num = 4; enemy_party.num = 3; } else if (Section.num === "41") { // 盗賊 enemy_party.id_num = 5; enemy_party.num = 1; } else if (Section.num === "70") { // 醜い百姓 enemy_party.id_num = 6; enemy_party.num = 25; } else if (Section.num === "16") { // 黒衣の祭司 enemy_party.id_num = 7; enemy_party.num = 3; } else if (Section.num === "56") { // 巨人 enemy_party.id_num = 8; enemy_party.num = 1; } else if (Section.num === "105") { // 食屍鬼 enemy_party.id_num = 9; enemy_party.num = 1; enemy_data[9].LIFE_POINT = Pip.LIFE_POINT; enemy_data[9].max_LIFE_POINT = Pip.max_LIFE_POINT; } else if (Section.num === "17") { // 砂のドラゴン enemy_party.id_num = 10; enemy_party.num = 1; } else if (Section.num === "19") { // 野蛮人 enemy_party.id_num = 11; enemy_party.num = 3; } else if (Section.num === "36" Section.subnum === 0) { // 三つ目獣 enemy_party.id_num = 12; enemy_party.num = 1; } else if (Section.num === "36" Section.subnum === 1) { // 兵士ベン enemy_party.id_num = 13; enemy_party.num = 1; } else if (Section.num === "116") { // ブロン enemy_party.id_num = 14; enemy_party.num = 3 + dice.die1pip; } else if (Section.num === "73") { // サソリ enemy_party.id_num = 15; enemy_party.num = 1; } else if (Section.num === "82") { // 見えない敵 enemy_party.id_num = 16; enemy_party.num = 1; Pip.quick = -1; } else if (Section.num === "78" Section.subnum === 0) { // 魔女ミニー enemy_party.id_num = 17; enemy_party.num = 1; } else if (Section.num === "78" Section.subnum === 1) { // 魔女アギー enemy_party.id_num = 18; enemy_party.num = 2; } else if (Section.num === "78" Section.subnum === 2) { // 魔女スクロッグ enemy_party.id_num = 19; enemy_party.num = 3; } else if (Section.num === "20") { // 狼 enemy_party.id_num = 20; enemy_party.num = 1; enemy[0].wolf_double_speed = 1; } else if (Section.num === "54") { // カメレオン怪人 enemy_party.id_num = 21; enemy_party.num = 1; } else if (Section.num === "114") { // 悪魔の落とし子 enemy_party.id_num = 22; enemy_party.num = 1; } else if (Section.num === "85") { // パトロール警官 enemy_party.id_num = 23; enemy_party.num = dice.die1pip; } else if (Section.num === "93") { // 見張り enemy_party.id_num = 24; enemy_party.num = dice.dice12pip; } else if (Section.num === "110") { // 僧 enemy_party.id_num = 25; enemy_party.num = 2; } else if (Section.num === "129") { // こそ泥サム enemy_party.id_num = 26; enemy_party.num = 1; } else if (Section.num === "131") { // アドルフ enemy_party.id_num = 27; enemy_party.num = 1; } else if (Section.num === "146") { // マオ enemy_party.id_num = 28; enemy_party.num = 1; } else if (Section.num === "154") { // 警官 enemy_party.id_num = 29; enemy_party.num = 1; } else if (Section.num === "216") { // ゼリー・モンスター enemy_party.id_num = 30; enemy_party.num = 1; } else if (Section.num === "171") { // ワニガエル獣 enemy_party.id_num = 31; enemy_party.num = 1; } else if (Section.num === "Fred") { // フレッド enemy_party.id_num = 32; enemy_party.num = 1; } else if (Section.num === "D7") { // 骸骨 enemy_party.id_num = 33; enemy_party.num = 1; } else if (Section.num === "D8") { // 亡霊 enemy_party.id_num = 34; enemy_party.num = dice.die1pip; } enemy_party.name = enemy_data[enemy_party.id_num].name; if (Section.num === "78") { // 魔女は1人ずつ襲いかかってくる enemy[Section.subnum].id_num = enemy_party.id_num; enemy[Section.subnum].name = enemy_data[enemy_party.id_num].name; enemy[Section.subnum].max_LIFE_POINT = enemy_data[enemy_party.id_num].max_LIFE_POINT; enemy[Section.subnum].LIFE_POINT = enemy_data[enemy_party.id_num].LIFE_POINT; enemy[Section.subnum].attack_base = enemy_data[enemy_party.id_num].attack_base; enemy[Section.subnum].extra_damage = enemy_data[enemy_party.id_num].extra_damage; enemy[Section.subnum].defence = enemy_data[enemy_party.id_num].defence; enemy[Section.subnum].attack_way = enemy_data[enemy_party.id_num].attack_way; enemy[Section.subnum].Bribery_amount = enemy_data[enemy_party.id_num].Bribery_amount; } else if (enemy_party.num === 1) { enemy[0].id_num = enemy_party.id_num; enemy[0].name = enemy_data[enemy_party.id_num].name; enemy[0].max_LIFE_POINT = enemy_data[enemy_party.id_num].max_LIFE_POINT; enemy[0].LIFE_POINT = enemy_data[enemy_party.id_num].LIFE_POINT; enemy[0].attack_base = enemy_data[enemy_party.id_num].attack_base; enemy[0].extra_damage = enemy_data[enemy_party.id_num].extra_damage; enemy[0].defence = enemy_data[enemy_party.id_num].defence; enemy[0].attack_way = enemy_data[enemy_party.id_num].attack_way; enemy[0].Bribery_amount = enemy_data[enemy_party.id_num].Bribery_amount; } else { // enemy_party.num 1 for (i = 0; i enemy_party.num; i++) { enemy[i].id_num = enemy_party.id_num; enemy[i].name = enemy_data[enemy_party.id_num].name + (i + 1); enemy[i].max_LIFE_POINT = enemy_data[enemy_party.id_num].max_LIFE_POINT; enemy[i].LIFE_POINT = enemy_data[enemy_party.id_num].LIFE_POINT; enemy[i].attack_base = enemy_data[enemy_party.id_num].attack_base; enemy[i].extra_damage = enemy_data[enemy_party.id_num].extra_damage; enemy[i].defence = enemy_data[enemy_party.id_num].defence; enemy[i].attack_way = enemy_data[enemy_party.id_num].attack_way; enemy[i].Bribery_amount = enemy_data[enemy_party.id_num].Bribery_amount; } } if (Section.num === "78" Section.subnum === 2) { // 魔女スクロッグ enemy[Section.subnum].Dragonfire_pill = 6 } if (Section.num === "20") { enemy[0].wolf_double_attack = 0; } if (Pip.Seeker_Needle_enemy_name === enemy_party.name) { if (Section.num === "78") { enemy[Section.subnum].LIFE_POINT = Math.floor(enemy[Section.subnum].LIFE_POINT/2); add_msg("投げ針で" + enemy[Section.subnum].name + "の生命点は半減している。"); } else { enemy[0].LIFE_POINT = Math.floor(enemy[0].LIFE_POINT/2); add_msg("投げ針で" + enemy[0].name + "の生命点は半減している。"); } } update_status(); add_msg("戦闘を開始するには「戦闘開始」をクリックせよ。「友好反応」「ワイロ」「逃亡」などはそのボタンをクリックせよ。"); }
https://w.atwiki.jp/suffix/pages/1173.html
関数の状態を保存する時(関数カウンタ等)に使える。 function outer(){ var x = 1; function inner(){ alert(x); x = x + 1; }; return inner; //returnが無いとinnerを宣言しただけの状態となり、以下のouter();を実行しても何も起きない。 } outer(); //1を表示 outer(); //2を表示 outer関数のcallオブジェクトにinner関数のcallオブジェクトを持たせていることにより、 inner関数の状態を保持しているイメージ。 詳しくは、以下参照。 変数のスコープとは
https://w.atwiki.jp/sevenlives/pages/1044.html
EPS ポイント(PostScript)? デバイス・インディペンデント? ハイレゾ・バウンディング・ボックス?
https://w.atwiki.jp/m_shige1979/pages/1253.html
for文(連想配列指定) 概要 for文(連想配列指定) サンプル CoffeeScript # 変数 str = "" # 連想配列作成 obj1 = "test1" "aaaa" "test2" "bbbb" "test3" "cccc" "test4" "dddd" "test5" "eeee" "test6" "ffff" "test7" "gggg" "test8" "hhhh" # for文による回数指定の繰り返し for key, value of obj1 str += "test sample " + key + "=" + value + " br/ " str += " br / " # セレクタでエレメントを取得 sample = document.querySelector("#sample") # パラメータ連結 sample.innerHTML = str javascript // Generated by CoffeeScript 1.3.3 var key, obj1, sample, str, value; str = ""; obj1 = { "test1" "aaaa", "test2" "bbbb", "test3" "cccc", "test4" "dddd", "test5" "eeee", "test6" "ffff", "test7" "gggg", "test8" "hhhh" }; for (key in obj1) { value = obj1[key]; str += "test sample " + key + "=" + value + " br/ "; } str += " br / "; sample = document.querySelector("#sample"); sample.innerHTML = str;
https://w.atwiki.jp/ruphy/pages/31.html
CTFontDescriptor Creating Font Descriptors CTFontDescriptor Create(name, size) CTFontDescriptor Create(attributes) CTFontDescriptor CreateCopy(attributes) CTFontDescriptor CreateCopy(variation) CTFontDescriptor CreateCopy(feature) CTFontDescriptor CreateMatchingFontDescriptors CTFontDescriptor CreateMatchingFontDescriptor Getting Attributes CTFontDescriptor CopyAttributes CTFontDescriptor CopyAttribute CTFontDescriptor CopyLocalizedAttribute Getting the Font Descriptor Type CTFontDescriptor GetTypeID class CTFontDescriptor Hash # def copy_attribute(descriptor, attribute) end # def copy_attributes(descriptor) end # def copy_localized_attribute(descriptor, attribute, language) end # def create_copy_with_attributes end # def create_copy_with_feature end # def create_copy_with_variation end # def create_matching_font_descriptor end # def create_matching_font_descriptors end # def create_with_attributes end # def create_with_name_and_size end # def get_type_id end end class CTFont # Constants ## Font Attributes URLAttribute, NameAttribute, DisplayNameAttribute, FamilyNameAttribute, StyleNameAttribute, TraitsAttribute, VariationAttribute, SizeAttribute, MatrixAttribute, CascadeListAttribute, CharacterSetAttribute, LanguagesAttribute, BaseLineAdjustAttribute, MacintoshEncodingsAttribute, FeaturesAttribute, FeatureSettingsAttribute, FixedAdvanceAttribute, OrientationAttribute, FormatAttribute, RegistrationScopeAttribute, PriorityAttribute, EnabledAttribute# = # 0, 1, 2, 3, 4 # rendering orientation class Orientation Default, Horizontal, Vertical = 0, 1, 2 end # Recognized format class Format Unrecognized, OpenTypePostScript, OpenTypeTrueType, TrueType, PostScript, Bitmap = 0, 1, 2, 3, 4, 5 end # Priority of font descriptors class Priority System, Network, Computer, User, Dynamic, Process = 10000, 20000, 30000, 40000, 50000, 60000 end # class StylisticClass end # ClassMaskShift = 28 UnknownClass, OldStyleSerifsClass, TransitionalSerifsClass, ModernSerifsClass, ClarendonSerifsClass, SlabSerifsClass, FreeformSerifsClass, SansSerifClass, OrnamentalsClass, ScriptsClass, SymbolicClass = class SymbolicTraits end ItalicTrait, BoldTrait, ExpandedTrait, CondensedTrait, MonoSpaceTrait, VerticalTrait, UIOptimizedTrait, ClassMaskTrait = ClassMaskShift = SlantTrait, WeightTrait, = class WeightTrait end class SlantTrait end class WidthTrait end end ## 使い方 # フォントデスクリプタからアトリビュートを取り出す url_attribute = font_descriptor[CTFont URLAttribute] # フォントデスクリプタにアトリビュートを設定する font_descriptor[CTFont OrientationAttribute] = CTFont Orientation Vertical See also CTFont Link CoreText
https://w.atwiki.jp/hamasta/pages/41.html
shell script 知りたいことを書いておく カレントディレクトリのファイルを列挙して指定ディレクトリ以下へまとめて移動 カレント以下のファイルのみ列挙 $ find ./* -type f echo * でカレントのファイルとディレクトリ列挙らしい @ubuntu-vm ~/shell_script$ echo * filecode.sh filecode_tmp.sh nkf_lu.sh trash カレント以下のファイルとディレクトリを列挙 type f をつければファイルのみ列挙 @ubuntu-vm ~/shell_script$ find . -name "*" -print . ./trash ./trash/result.log ./trash/test.sh ./trash/param.sh ./nkf_lu.sh ./nkf_lu_lw.sh ファイル・ディレクトリリストについて改行を除く、スペース区切りでつなげる @ubuntu-vm ~/shell_script$ find . -name "*" -print0 | xargs -0 . ./trash ./trash/result.log ./trash/test.sh ./trash/param.sh ./trash/result2.log ./nkf_lu.sh ./nkf_lu_lw.sh ./filecode.sh ./filecode_tmp.sh .cgiファイルの改行コード変換 @ubuntu-vm /mnt/hgfs/home_hoge/# find . -name "*.cgi" -type f -print0 | xargs -0 nkf -Lu -d --overwrite UTF-8出力は-wをつける ファイルの自動判別結果表示は nkf -g filename ファイル所有者とグループの一括変更 chown -R user group * 文字コード変換コマンドnkfの使い方まとめ linux http //it.kndb.jp/entry/show/id/744 Linuxで文字コード一括変換(2) http //www.eitaro-saba.com/001/linux2.html 実行したいフォルダに移動後、 find . -type f -regex ".*\.\(php\|tpl\)$" -print0 | xargs -0 nkf -w -Lu --overwrite これで指定した拡張子のファイル全てUTF8に変換、改行コードがLFになります。拡張子を増やしたい場合は、\(php\|tpl\|xxx\) のように増やしていけます。
https://w.atwiki.jp/suffix/pages/1008.html
var 変数 = document.evaluate(XPathの評価式,どこから取得するか[document.body]等,null[HTMLの場合],結果の取得方法,null); で取得し、 var 変数.snapShotItem(index)で要素を得る。 XPathの評価式の書き方については、 http //d.hatena.ne.jp/javascripter/20080425/1209094795 http //d.hatena.ne.jp/amachang/20071112/1194856493 が分かりやすい。 結果取得方法については、いくつか方法があるが、基本7のORDERD_NODE_SNAPSHOT_TYPEで良さそう。 その他の取得方法形式については、 https //developer.mozilla.org/en/DOM/document.evaluateのResult Types にあるので、参照にすると良い。 また、http //d.hatena.ne.jp/language_and_engineering/20090818/p1に書いてある、 FireBugを開き,コンソールの一番下の「>>>」に $x( XPath記法 ) は便利なので、是非とも試したい。
https://w.atwiki.jp/projecthikky/pages/84.html
今日の課題:Canvasで弧を描く コード https //paiza.io/projects/QcigcidDIm0B9mD-Ghes4Q 実行結果 https //out.paiza.io/projects/QcigcidDIm0B9mD-Ghes4Q/output.html !DOCTYPE html html head title HTML5の練習@ヒッキープログラミングスレ /title style type="text/css" body { background-color silver; } canvas { background-color white; } /style /head body h4 弧を描く /h4 canvas id="mycanvas" width="640" height="480" /canvas script language="javascript" type="text/javascript" function mydraw() { var canvas = document.getElementById( mycanvas ); var ctx = canvas.getContext( 2d ); ctx.beginPath(); ctx.strokeStyle = red ; ctx.moveTo(50, 50); ctx.arcTo(120, 180, 200, 200, 200); ctx.lineTo(300, 350); ctx.stroke(); } mydraw(); /script /body /html arcTo(x1,y1,x2,y2,r) よくわからん
https://w.atwiki.jp/yo-kichi/pages/16.html
設定ファイルをJavaで読み込む 時間取得まとめ Javaについて思ったこと Singletonで自身がスレッドになるクラスでなぞエラー Javaで効果音、BGM Javaテンプレ **何ができるか ***実装したい機能 ---- **感想 ---- コメント #pcomment(below2,noname,20,enablenamelink,enableurl) コメント
https://w.atwiki.jp/m_shige1979/pages/1038.html
パッケージ名 概要 空のオブジェクトを生成することでユニークなオブジェクト名を定義する サンプル ソース var Package01 = function(){}; // ベースオブジェクト定義 Package01.MyClass = function(name, count){ // プライベートメンバ var _name = name; var _count = count; // プライベートメソッド var _getAdd = function(val){ _count += val; } // パブリックメソッド this.getData = function(val){ _getAdd(val); return name = + _name + count= + _count; } }; Package01.MyClass.prototype.getData02 = function(){ return Package Test ; } // オブジェクトのインスタンスを生成して実行 var obj1 = new Package01.MyClass( User03 , 3000); // MyBaseClassのメソッド結果 document.writeln(obj1.getData(10)); document.writeln( br / ); // MyBaseClassのメソッド結果 document.writeln(obj1.getData02()); document.writeln( br / ); 結果 name = User03 count=3010 Package Test