Как стать автором
Обновить

Ненормальное программирование. Может так писал Бог?

Время на прочтение3 мин
Количество просмотров2.4K

Допустим надо написать Мир. Запрограммировать.
Как бы тогда назывался среда программирования?

Так… думаем…
Что у нас в мире главное?
Правильно — информация!
Information — длинно. Во — inform. 6 — букв :(
Добавляем седьмую, получаем — inform7.

Гуглим —

есть!



www.inform7.com


image



Все как всегда бесплатно и есть под все платформы
I7_5Z71_OSX.dmg
Mac OS X version

I7_5Z71_Windows.exe
Windows version

I7_5Z71_Linux_all.tar.gz
Linux version

Устанавливаем.
Ну что напишем?
Hello word или Notepad?
Голосуем…



Понял! C Hello word все просто. Значит Notepad.
Блокнот это тип вещи. Блокнот имеет упорядоченный текст, который называется заметка. Обычно заметка в блокноте это "".<br>


Так… не проходит. Ах да, все языки программирования на английском! Пишем:…


	A notepad is a kind of thing. A notepad has an indexed text called memo. The memo of a notepad is
	usually "".
	Understand the command "read" as something new.

	Reading is an action applying to one thing and requiring light. Understand "read [something]" as
	reading.
	Check reading:
		if the noun is not a notepad:
			say "Nothing is written on [the noun]." instead;
		otherwise if the memo of the noun is "":
			say "At the moment, [the noun] is blank." instead.
	Carry out reading:
		if the memo of the noun is not "":
			say "On [the noun] you find the words '[memo of the noun].'";
		otherwise:
			say "Nothing is written on [the noun]."

	Writing it on is an action applying to one topic and one thing and requiring light. Understand "write
	[text] on [something]" as writing it on.
	Check writing it on:
		if the second noun is not a notepad:
			say "You can't write anything on [the second noun]!" instead;
		otherwise if the second noun is the slate:
			if the player does not carry the chalk:
				say "You'd need some chalk to do that." instead.
	Carry out writing it on:
		let T be indexed text;
		let T be the topic understood;
		change the memo of the second noun to T;
		say "Writing '[T]' on [the second noun]."
	
	Erasing is an action applying to one thing and requiring light. Understand "erase [something]" as erasing.
	Check erasing:
		if the noun is not a notepad:
			say "There's nothing on [the noun] to erase." instead;
		otherwise if the memo of the noun is "":
			say "At the moment, nothing is written on [the noun]."
	Carry out erasing:
		change the memo of the noun to "";
		say "You erase what was written on [the noun]."
		
		
	The Lab is a room. A piece of chalk is in the Lab.
	The player carries a fish. The description of the fish is "Scaly."
	The player carries a slate. The slate is a notepad. The description of the slate is "Black."
	
	Test me with "read fish / read slate / write E=mc2 on fish / write E=mc2 on slate / take chalk / write E=mc2 on slate / read slate / erase fish / erase slate / read slate".
	


тестируем

>test me
(Testing.)

>[1] read fish
Nothing is written on the fish.

>[2] read slate
At the moment, the slate is blank.

>[3] write e=mc2 on fish
You can't write anything on the fish!

>[4] write e=mc2 on slate
You'd need some chalk to do that.

>[5] take chalk
Taken.

>[6] write e=mc2 on slate
Writing "e=mc2" on the slate.

>[7] read slate
On the slate you find the words "e=mc2."

>[8] erase fish
There's nothing on the fish to erase.

>[9] erase slate
You erase what was written on the slate.

>[10] read slate
At the moment, the slate is blank.

>	


Система позиционируется как платформа для программирования interactive fiction (игры) на естественном языке.






Спасибо SkywalkerY!
Теги:
Хабы:
+18
Комментарии29

Публикации