
スパコンは人間脳の1000万倍量の電力を消費する。
・・・・・・・・・・
昨日アップしたリンゴのゲームのソースです。
HTML部分、JS宣言文などは書いてません。
enchant.jsはゲームの処理に必要なことが前もって用意されているので、非常に短い文でゲームを書くことができます。
enchant();エンチャントジェイエスの呼び出し
window.onload = function(){ロードが完了するまで画面を開かない
var game = new Game(320, 320);ゲームオブジェクトの生成
game. fps = 16;1秒ごとの画面更新速度
game.score = 0;
var label;
var bear;
var e_left = document.createElement('div');
e_left.id = "left";
e_left.style.width = "232px";//232px
e_left.style.height = "465px";//465px
e_left.style.display = "block";
e_left.style.position = "absolute";
e_left.style.left = "0px";
e_left.style.zIndex = "10000";
var e_right= document.createElement('div');
e_right.id = "right";
e_right.style.width = "232px";//232
e_right.style.height = "465px";//465
e_right.style.display = "block";
e_right.style.position = "absolute";
e_right.style.right = "0px";
e_right.style.zIndex = "10000";
var objBody = document.getElementByTagName("body").item(0);
e_left = objBody.appendChild(e_left);
e_left.onclick = function(){alert(0)};
objBody.appendChild(e_right);
game.preload('images/chara1.gif','images/mao0.gif','images/icon0.gif');
事前にこれらのファイルを読み込んでおく
game.onload = function(){
var bg = new Sprite(320,320);背景スプライト
bg.backgroundColor = "rgb(0,200,255)";
var maptip = game.assets['images/map0.gif'];
var image = new Surface(320,320);
for(var i = 0; i < 320; i += 16){
image.draw(maptip, 7*16, 0,16,16,i,320-16,16,16);
}
bg.image = image;
game.rootScene.addChild(bg);ルートシーンに背景追加
label = new Label("");ラベルオブジェクト生成
game.rootScene.addChild(label);ラベル追加
bear = new Sprite(32,32);熊オブジェクト生成
bear.image = game.assets['images/chara1.gif'];
bear.x = 160-16;
bear.y = 320-16-32;熊の位置は、320(画面)-16(熊自身)-32(地面ブロック)の高さ
bear.anim = [0,1,0,2];
bear.frame = 0;
game.rootScene.addChild(bear);
bear.tick = 0;
bear.addEventListener(Event.EVENT_FRAME, function(){
if(game.input.left){インプットはボタンを押されたら
bear.x -= 3;
bear.scaleX = -1;
}
else if(game.input.right){
bear.x += 3;
bear.scaleX = 1;スケールXは-1のとき左向き、1のとき右向き
}
bear.tick++;
if(!e_left.onclick && !e_right.onclick){どちらも押されてなかったら
bear.frame = bear.anim[0];
}else{
bear.frame = bear.anim[bear.tick%4];
}
});
};
game.addApple = function(x,speed){
var apple = new Sprite(16,16);
apple.image = game.assets['images/icon0.gif'];アセットは前もってロードされた要素のこと
apple.x = x;
apple.y = -16;
apple.frame = 15;
apple.speed = speed;
game.rootScene.addChild(apple);
apple.addEventListener(Event.ENTER_FRAME,function(){
apple.y += apple.speed;
if(bear.within(apple,16))[ウィズインは衝突判定、衝突部分が16ピクセルだと判定する
game.score+=30;
game.rootScene.removeChild(apple);
}
else if (apple.y > 320-16){
game.rootScene.removeChild(apple);
}
});
};
game.tick 16*30;
game.rootScene.addEventListener(Event.ENTER_FRAME, function(){
game.tick--;
if(game.tick>0){
if((game.tick%10)===0){
var x = Math.floor(Math.random()*300);
var speed = 3 + Math.floor(Math.random()*6);
game.addApple(x,speed);
}
label.text = "TIME:"+Math.floor(game.tick/16)+"<BR>SCORE:"+game.score;
label.font="25px sans-serif";
}
else if(game.tick===0){
game.end(game.score,"YOUR SCORE"+game.score);
}
});
game.start();
};
function rand(num){
return Math.floor(Math.random()*num);
}
・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・
人工知能への道
人類が到達可能な“虫”型ロボットに一体どのような肉付けを行っていけば、最終的に人間に行き着くのか。
考えてみた。
センサーによる反射と危険回避(現在)
↓
自己保存プログラム(高度の危険回避プログラム)
・危険と危険でないものを見分ける
・電力の低下に対して自分で電力を補おうとする
・地形的に自分に害を及ぼすような場所を避ける
・また、そういった危険を学習する
↓
疑似情動プログラム
・自分に害を及ぼすものを極力さけようとする
・電力のセーブ状態と亢進状態を作る
・害から逃げ、利益を追うとき亢進状態を作る
・自身を守るための攻撃プログラムを作る
↓
予測プログラム
・以前の体験を学習し、次のパターンを予測する
・予測によって、セーブ・亢進状態を切り替える
・自分の生活環境について、前に見た状態と比較する
・これから見える風景についても予測する(“あたりまえ”をプログラムする)
↓
表象プログラム
・センサー(映像、音、臭い、触覚)で感じたことを記憶する
・表象記憶同士で関連性の高いものどうしを連想記憶にする
・逐次的に連想記憶を発生させ、疑似表象(映像・音)を自己内で再生させる
・表象体験したことも、記憶させる(表象体験自体も表象体験となる)
・表象体験で利益/不利益に関係することは情動記憶として亢進状態を伴うようにする
↓
言語プログラム
・物に命名を行う
・言語の連想記憶再現を逐次行う(思い出し)
↓
言語処理プログラム
・計算や作文を行う
・書かれたこと、言われたことを理解する
・文章で書かれたこと、言われたことを元に表象を発生させる
・・・・・・・・・・・・・・・・・
本格的に人脳と同じことをしようとしたら、相当のリソースと電力が必要になるはずです。
それも、長時間動かし続けないといけないのです。
脳は全体重の2%ほどしかありませんが、エネルギーの消費量は18%もあります。
これだけのことを継続するということは相当量のエネルギーが必要なんです。
・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・
英語学習日記英語のニュースを翻訳します。
アメリカのシーク教寺院の銃乱射事件について
At least six people were killed and more wounded when a gunman opened fire on worshippers at a Sikh temple in the US.
シーク教の寺院で男が射撃をはじめ6名が少なくとも死亡した。
The shooting took place shortly before 10.30am local time at a place of worship in Oak Creek, south of Milwaukee, Wisconsin.
ウィスコンシン、南ミルウォーキー、射撃は10時半のお祈りの前に行われた。
Police said the gunman was shot by an officer who enagaged him in fire immediately after arriving on the scene. The officer was hit several times, but was able to return fire. The suspect is believed to have died, and the officer was taken to hospital, where he is critically ill.
現場に到着した警察官に男は撃たれた。警察官は数回撃たれたが、それでも撃ち返した。容疑者は死んだものと思われる。警察官は重傷で病院へ搬送。
Emergency teams found the bodies of four victims inside the temple. Three more corpses lay outside the building, apparently including that of the suspect. A police spokesman said the officer who arrived on the scene was able to "put down" the gunman.
警官隊は4人の死者を寺院内で発見。3名も外で発見された。容疑者も含まれている。警察側は、警察官はガンマンを取り押さえることができたはずだと言っている。
The officer was taken to hospital and was admitted for surgery. It is thought he is one of three people said to have been left in a critical condition as a result of gunshot wounds. There were no confirmed reports of the total number of people injured, but early reports put the figure between four and up to 30.
警察官は病院で手術を受けるために搬送された。彼は今回の射撃で重傷になった3名うちの1名だ。全体で何名負傷したか分からない。今のところ、4名から多くて30名と見られている。
Police said Sunday afternoon that the situation was contained. There had earlier been fears that a second gunman remained at large and was holding worshippers hostage. A cordon was placed around the temple on Sunday afternoon – leading to conflicting initial reports as to how many people remained inside, and the extent of their injuries.
いまだ恐怖がある、そこでは信仰者を誘拐した容疑者がまだ捕まっていないからだ。日曜午後には寺院の周囲に非常線が引かれた。当初の報告より負傷者は多くなる見込みだ。
Ambulances and police marksman surrounded the temple. But early tactical sweeps by officers indicated the shootings were carried out by a sole gunman.
救急車と射撃手が寺院を取り囲んでいる。しかし、当初の警官隊による捜査では射撃事件は一人の容疑者によって行われたものだとされている。
・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・
自分で考えて英語を書くよりも、新聞などで書かれた英文を翻訳する方が表現の幅が広がる。
英語はリスニングはOKだから、やはり、文章理解力を高めないといけない。
それは同時に読解スピードを上げるということにもつながる。
TOEIC900点へ・・・目標は遠いようで、
近い。・・・・・・・・・
とにかく、大研修が二週間後にあって、
そのあとです。
TOEICの日程は11月18日と12月9日。
11月は忙し過ぎる。
ハングル(韓国語)検定は次が11月11日で、できれば4級を受けたかったんですが、その日はハーフマラソン大会の当日でした。
12月9日、TOEICでいくか。
・・・・・・・・・・・・・・・・
日
シーク教寺院
英
Sikhism temple
韓
시크교(seeking religion) 사원
シクキョ サウォン
中
锡克教寺院
xi1 ke4 jiao4 si4 yuan4