Amsterdam Compiler Kit を6800向けに改造する (5) デモが動作するようになった
Amsterdam Compiler Kit を改造してMC6800用のコードを出力する試みの5回目。ackに含まれているexampleのいくつかが 動くようになりました。
標準入力からの入力が必要なので、emu6800にパッチを当てて使っています。詳しくは README を読んでください。
数当てゲーム examples/hilo.c
1970年代のBASIC入門記事にありそうな数当てゲームです。0-99までの数を当てます。乱数を初期化していないので毎回同じ数になるのですが、仕方ないです。タイマーないし。
$ ack -me6800 hilo.c $ emu6800 6800 e6800.img /dev/null Hi there! I'm written in C. Before we start, what is your name? > zu2 Hello, zu2! See if you can guess my number. > 50 Try a bit higher. > 75 Try a bit lower. > 63 Try a bit higher. > 67 You got it right in only 4 goes! Would you like another go? >
ソロアドベンチャー examples/paranoia.c
コメントによると1987年のSpaceGamer/FantasyGamer誌(No.77)に掲載されたゲーム。コンピュータープログラムではなく、紙の上で番号を選択していく形式。ゲームブックですな。
コンピューターで遊べるようにVAX上のCに移植されたものを、2007年にackに移植したバージョンです。
/* This is a solo paranoia game taken from the Jan/Feb issue (No 77) of
“SpaceGamer/FantasyGamer" magazine.Article by Sam Shirley.
Implemented in C on Vax 11/780 under UNIX by Tim Lister
Very slightly modernised to run on 2007-era (!) compilers by
David Given.This is a public domain adventure and may not be sold for profit */
掲載誌は archive.orgで読めます。
起動してみました。日本語訳欲しいな。
$ ack -me6800 paranoia.c $ emu6800 6800 e6800.img /dev/null Welcome to Paranoia! HOW TO PLAY: Just press
until you are asked to make a choice. Select 'a' or 'b' or whatever for your choice, then press . You may select 'p' at any time to get a display of your statistics. Always choose the least dangerous option. Continue doing this until you win. At times you will use a skill or engage in combat and and will be informed of the outcome. These sections will be self explanatory. HOW TO DIE: As Philo-R-DMD you will die at times during the adventure. When this happens you will be given an new clone at a particular location. The new Philo-R will usually have to retrace some of the old Philo-R's path; hopefully he won't make the same mistake as his predecessor. HOW TO WIN: Simply complete the mission before you expend all six clones. If you make it, congratulations. If not, you can try again later. ---------- More ----------
他のサンプルはまだ動きません
mandelbrot.c と startrek.c は double が必要。浮動小数点サポートを追加する気力がないので、パス。
dhrystone は _gettimeofday が必要。ダミーをでっちあげれば動くか?
ディスカッション
コメント一覧
まだ、コメントがありません