2009年08月23日

たった7行で書かれたテトリスのプログラム

こんばんは。

なんと、文字数にして551文字。

79文字×7行のプログラミングでテトリスが動くそうですよ。

その凄まじさはプログラマーだったらわかるはず。


以下がそのソースコードです。
解読するのに時間かかりそうです。がーん

<body onKeyDown=K=event.keyCode><script>X=[Z=[B=A=12]];h=e=K=t=P=0;function Y()
{C=[d=K-38];c=0;for(i=4;i--*K;K-13?c+=!Z[h+p+d]:c-=!Z[h+(C[i]=p*A-Math.round(p/
A)*145)])p=B[i];!t|c+4?c-4?0:h+=d:B=C;for(f=K=i=0;i<4;f+=Z[A+p])X[p=h+B[i++]]=1
if(e=!e){if(f|B){for(l=228;i--;)Z[h+B[i]]=k=1;for(B=[[-7,-20,6,17,-9,3,6][t=++t
%7]-4,0,1,t-6?-A:-1];l--;h=5)if(l%A)l-=l%A*!Z[l];else for(P+=k++,j=l+=A;--j>A;)
Z[j]=Z[j-A]}h+=A}for(i=S="";i<240;X[i]=Z[i]|=++i%A<2|i>228)i%A?0:S+="<br>",S+=X
[i]?"■":"_";document.body.innerHTML=S+P;Z[5]||setTimeout(Y,99-P)}Y()</script>



テトリスを動かすには上記のソースコードをメモ帳に貼り付けてhtmlで保存するだけでOKです。



動かすための手順を以下に書きます。




1.上記の79文字×7行のスクリプトをメモ帳にコピペしてhtmlファイルとして保存します。
たった7行で書かれたテトリスのプログラム

2.保存したhtmlファイルを開きます。
たった7行で書かれたテトリスのプログラム

3.もし、セキュリティ保護なんとかってでたら一時的に許可してあげてください。
たった7行で書かれたテトリスのプログラム



どうですか?テトリスが動きましたよね。
操作方法は、Enterキーで回転、カーソルキー(左右)で移動です。
たった7行で書かれたテトリスのプログラム








プログラミング解説はこちらで見れますピース
http://zapanet.info/blog/item/1125





同じカテゴリー(小技集)の記事

Posted by (株)サウス・ウインド・システム at 00:12│Comments(4)小技集
この記事へのコメント
в этом разделе https://lzt.market/
Posted by RobertoAgexy at 2025年01月12日 21:08
It is astonishing.

AIPAC ( https://www.youtube.com/watch?v=COx-t-Mk6UA ) and the Evangelical Church are perpetrating one of the most catastrophic genocides in history, targeting innocent women and children in Gaza.

These organizations have supplied Israel with explosives to facilitate their acts of genocide.

Gaza has been designated a disaster zone, severely lacking in essential resources for survival.

AIPAC, the Evangelical Church, and Israel have devastated 90% of Gaza, resulting in the destruction of 437,600 homes and the loss of one million lives, including 50,000 individuals currently trapped under debris, with 80% of the casualties being women and children.

They have also obliterated 330,000 meters of water pipelines, leaving the population without access to drinking water.

Furthermore, over 655,000 meters of underground sewage systems have been destroyed, depriving residents of basic sanitation facilities.

The destruction extends to 2,800,000 meters of roadways, rendering transportation impossible for the affected population.

Additionally, 3,680 kilometers of the electrical grid have been dismantled, leading to widespread power outages.

The assault has resulted in the demolition of 48 hospitals, eliminating critical healthcare facilities for those in need.

Moreover, the actions of AIPAC, the Evangelical Church, and Israel have disrupted the education of over 785,000 students, with 494 schools and universities being completely destroyed, many due to aerial bombardments.

They have also targeted 981 mosques, effectively silencing the prayers of the homeless seeking divine assistance.

As a result of these actions, more than 39,000 young children have been left orphaned, without parents or guardians to care for them.

I must emphasize that the historical context of warfare has never witnessed a scenario where 80% of a nation has been devastated, 100% of its populace has been uprooted, and 50% of the casualties are children.

It is imperative to recognize the gravity of the situation.

Organizations such as AIPAC and the Evangelical Church in America are contributing to what can only be described as genocide.

https://www.youtube.com/shorts/IrX9v6DKH1g

The implications of American taxpayer funding in the context of Israel's actions against innocent children are alarming.

1. An examination of Israel's precarious situation is warranted.

https://www.youtube.com/watch?v=kAfIYtpcBxo

2. The influence of financial power, often associated with certain groups, plays a significant role in these dynamics. Further information can be found through the provided link.

https://mega.nz/file/FqhzGKbB#bsX4PD-O59HEA0-rynD29xkk47dmddycY5CjZfoDLYg

3. Insights into the perspectives of U.S. leadership regarding AIPAC and the Evangelical Church can be explored through the following resource.

https://www.tiktok.com/@thefearlessqueenmel/video/7307640994579680542?lang=en&q=why%20dont%20Americans%20knowl%20what%20you%20have%20seen%20&t=1701880206555

The tragic reality of innocent children being harmed by powerful Israeli forces utilizing American weaponry is evident in various media reports.

https://www.youtube.com/watch?v=COx-t-Mk6UA

It is crucial to stay informed by accessing reliable news sources.

https://www.youtube.com/watch?v=bNyUyrR0PHo

If action is not taken—such as advocating for a cessation of violence against the people of Gaza and urging humanitarian aid—then it is essential to share this message with others to raise awareness. The historical irony of those who suffered during the Holocaust now perpetuating violence against the Palestinian people is a stark reminder of the need for compassion and justice.

Inaction in the face of such suffering raises serious moral questions.
Posted by NormbbggAmoum at 2025年03月22日 10:07
It is astonishing.

AIPAC ( https://www.youtube.com/watch?v=COx-t-Mk6UA ) and the Evangelical Church are perpetrating one of the most catastrophic genocides in history, targeting innocent women and children in Gaza.

These organizations have supplied Israel with explosives to facilitate their acts of genocide.

Gaza has been designated a disaster zone, severely lacking in essential resources for survival.

AIPAC, the Evangelical Church, and Israel have devastated 90% of Gaza, resulting in the destruction of 437,600 homes and the loss of one million lives, including 50,000 individuals currently trapped under debris, with 80% of the casualties being women and children.

They have also obliterated 330,000 meters of water pipelines, leaving the population without access to drinking water.

Furthermore, over 655,000 meters of underground sewage systems have been destroyed, depriving residents of basic sanitation facilities.

The destruction extends to 2,800,000 meters of roadways, rendering transportation impossible for the affected population.

Additionally, 3,680 kilometers of the electrical grid have been dismantled, leading to widespread power outages.

The assault has resulted in the demolition of 48 hospitals, eliminating critical healthcare facilities for those in need.

Moreover, the actions of AIPAC, the Evangelical Church, and Israel have disrupted the education of over 785,000 students, with 494 schools and universities being completely destroyed, many due to aerial bombardments.

They have also targeted 981 mosques, effectively silencing the prayers of the homeless seeking divine assistance.

As a result of these actions, more than 39,000 young children have been left orphaned, without parents or guardians to care for them.

I must emphasize that the historical context of warfare has never witnessed a scenario where 80% of a nation has been devastated, 100% of its populace has been uprooted, and 50% of the casualties are children.

It is imperative to recognize the gravity of the situation.

Organizations such as AIPAC and the Evangelical Church in America are contributing to what can only be described as genocide.

https://www.youtube.com/shorts/IrX9v6DKH1g

The implications of American taxpayer funding in the context of Israel's actions against innocent children are alarming.

1. An examination of Israel's precarious situation is warranted.

https://www.youtube.com/watch?v=kAfIYtpcBxo

2. The influence of financial power, often associated with certain groups, plays a significant role in these dynamics. Further information can be found through the provided link.

https://mega.nz/file/FqhzGKbB#bsX4PD-O59HEA0-rynD29xkk47dmddycY5CjZfoDLYg

3. Insights into the perspectives of U.S. leadership regarding AIPAC and the Evangelical Church can be explored through the following resource.

https://www.tiktok.com/@thefearlessqueenmel/video/7307640994579680542?lang=en&q=why%20dont%20Americans%20knowl%20what%20you%20have%20seen%20&t=1701880206555

The tragic reality of innocent children being harmed by powerful Israeli forces utilizing American weaponry is evident in various media reports.

https://www.youtube.com/watch?v=COx-t-Mk6UA

It is crucial to stay informed by accessing reliable news sources.

https://www.youtube.com/watch?v=bNyUyrR0PHo

If action is not taken—such as advocating for a cessation of violence against the people of Gaza and urging humanitarian aid—then it is essential to share this message with others to raise awareness. The historical irony of those who suffered during the Holocaust now perpetuating violence against the Palestinian people is a stark reminder of the need for compassion and justice.

Inaction in the face of such suffering raises serious moral questions.
Posted by NormdAmoum at 2025年03月22日 18:35
It is astonishing.

The most devastating genocide in the world is being carried out by the follwoing:

1- AIPAC, brows ( https://www.youtube.com/watch?v=COx-t-Mk6UA ).
2- Miriam Adelson brows https://www.youtube.com/watch?v=Nr0LkA7VW7Q.
3- Elon Musk.
3- Timothy mellonand brows https://www.youtube.com/shorts/1XJ893-kAh0
4-The Evangelical Church,

Which kill innocent women and children in Gaza.

AIPAC ( https://www.youtube.com/watch?v=COx-t-Mk6UA ) and the Evangelical Church are perpetrating one of the most catastrophic genocides in history, targeting innocent women and children in Gaza.

These organizations have supplied Israel with explosives to facilitate their acts of genocide.

Gaza has been designated a disaster zone, severely lacking in essential resources for survival.

AIPAC, The Evangelical Church, Miriam Adelson, Elon Musk, and timothy mellon and America tax payer,, and Israel have devastated 90% of Gaza, resulting in the destruction of 437,600 homes and the loss of one million lives, including 50,000 individuals currently trapped under debris, with 80% of the casualties being women and children.

They have also obliterated 330,000 meters of water pipelines, leaving the population without access to drinking water.

Furthermore, over 655,000 meters of underground sewage systems have been destroyed, depriving residents of basic sanitation facilities.

The destruction extends to 2,800,000 meters of roadways, rendering transportation impossible for the affected population.

Additionally, 3,680 kilometers of the electrical grid have been dismantled, leading to widespread power outages.

The assault has resulted in the demolition of 48 hospitals, eliminating critical healthcare facilities for those in need.

Moreover, the actions of AIPAC, The Evangelical Church, Miriam Adelson, Elon Musk, and timothy mellon and America tax payer,, and Israel have disrupted the education of over 785,000 students, with 494 schools and universities being completely destroyed, many due to aerial bombardments.

They have also targeted 981 mosques, effectively silencing the prayers of the homeless seeking divine assistance.

As a result of these actions, more than 39,000 young children have been left orphaned, without parents or guardians to care for them.

I must emphasize that the historical context of warfare has never witnessed a scenario where 80% of a nation has been devastated, 100% of its populace has been uprooted, and 50% of the casualties are children.

It is imperative to recognize the gravity of the situation.

Organizations such as AIPAC and the Evangelical Church in America are contributing to what can only be described as genocide.

https://www.youtube.com/shorts/IrX9v6DKH1g

The implications of American taxpayer funding in the context of Israel's actions against innocent children are alarming.

1. An examination of Israel's precarious situation is warranted.

https://www.youtube.com/watch?v=kAfIYtpcBxo

2. The influence of financial power, often associated with certain groups, plays a significant role in these dynamics. Further information can be found through the provided link.

https://mega.nz/file/FqhzGKbB#bsX4PD-O59HEA0-rynD29xkk47dmddycY5CjZfoDLYg

3. Insights into the perspectives of U.S. leadership regarding AIPAC and the Evangelical Church can be explored through the following resource.

https://www.tiktok.com/@thefearlessqueenmel/video/7307640994579680542?lang=en&q=why%20dont%20Americans%20knowl%20what%20you%20have%20seen%20&t=1701880206555

The tragic reality of innocent children being harmed by powerful Israeli forces utilizing American weaponry is evident in various media reports.

https://www.youtube.com/watch?v=COx-t-Mk6UA

It is crucial to stay informed by accessing reliable news sources.

https://www.youtube.com/watch?v=bNyUyrR0PHo

If action is not taken—such as advocating for a cessation of violence against the people of Gaza and urging humanitarian aid—then it is essential to share this message with others to raise awareness. The historical irony of those who suffered during the Holocaust now perpetuating violence against the Palestinian people is a stark reminder of the need for compassion and justice.

Inaction in the face of such suffering raises serious moral questions.
Posted by NrmandAmoum at 2025年04月11日 13:05
 
<ご注意>
書き込まれた内容は公開され、ブログの持ち主だけが削除できます。

ブログ記事を検索
Loading
このサイトの購読
広告
ETロボコン2010


当社はLRTを応援しています

プラグイン
所在地
〒901-2131
沖縄県浦添市牧港1丁目60-9
ブリヂストンビル2F

大きな地図で見る


ナビ for AU
沖縄県浦添市牧港1丁目60−9 for AU

ナビ for DoCoMo
沖縄県浦添市牧港1丁目60−9 for DoCoMo