| ホーム > 祈りの小部屋 > Java言語による主の祈り | 検索 | 更新情報 |
|
|
|
「主の祈り」をJava言語で書いてみました。 ある意味ではこれはジョークなのですが、 プログラミング言語の機能をうまく使って、 信仰的な内容もできるだけ表現しようと試みています。
/**
* Prayer.java - Version 1.2.2
* Programmed by Hiroshi Yuki in 1998. Revised in 1999, 2008.
* hyuki@hyuki.com
* http://www.hyuki.com/prayer/prayjava.html
*/
import java.net.*;
import java.io.*;
import java.util.*;
import Heaven.faith.*;
import Heaven.hope.*;
import Heaven.love.*;
public class Prayer extends HumanBeing {
private HolySpiritualOutputStream out;
static public void main(String args[]) {
try {
Prayer We = new Prayer();
while (isAlive(We)) {
We.worshipGod();
We.prayForDailyNeed();
We.Amen();
}
} catch (Exception e) { }
}
private Prayer() throws IOException {
Socket socket = new Socket("OurFather.in.Heaven", Heaven.PRAYER_PORT);
out = new HolySpiritualOutputStream(socket.getOutputStream());
}
private void worshipGod() throws IOException {
out.write("hallowed be Your name,");
out.write("Your kingdom come,");
out.write("Your will be done on earth as it is in heaven.");
}
private void prayForDailyNeed() throws IOException {
out.write("Give us today our daily bread.");
out.write("Forgive us our debts,");
out.write("as we also have forgiven our debtors.");
out.write("And lead us not into temptation,");
out.write("but deliver us from the evil one.");
}
private void Amen() throws IOException {
out.write("for Yours is the kingdom and the power and the glory for ever.");
out.write("Amen.");
}
}
作成者の意図したことを(若干野暮な話になりますが)書いておきます。
けっこうまじめに(信仰的にとプログラム的に)考えましたが、 以下の点がまだ課題として残っています。 信仰をもったプログラマによるバージョンアップを期待します。(^_^)
以下は読者からの指摘です。すばらしい…。
感想・意見・バグ報告は結城浩 hyuki@hyuki.com までお気軽にどうぞ。 表題に [prayjava] という文字列を含めていただけると感謝です。
Java言語による(いや、何でもいいんですが)「使徒信条」を誰か書きませんか。
とか言ってたら、CakeさんがSmalltalkで詩篇を!
日本全国の方言による「主の祈り」が紹介されています(heidiさんのページ)。
CakeさんがSmalltalkで詩篇を書きました。
結城さん、すごいっす。おそれいりました。 思わず笑っちゃいましたが、 笑ったあとでよく考えると笑っていいかどうかわかんなくなるとこまですごい。