Talk:Strand

From IFWiki

Revision as of 00:21, 20 February 2025 by Jkjyuio (talk | contribs) (wiki doesnt like code.)

This is the talk page for Strand. See How to edit IFWiki to find out about using talk pages, and editing the wiki generally.


Thanks for this page, Jkjyuio. How does this software relate to Strand Games (the company) and Brahman (the software)? Would you be able to create pages for them too? Jonathan (talk) 21:44, 19 February 2025 (UTC)

Brahman was an IF development system started in 1990 projected from the core idea: "Write the whole game in its own parser!"

The name comes from the concept of starting with an empty "universe" and creating things within the game's own parser. After which the creative entity "become the player" and is thereafter a mortal player no longer able to create or modify the universe except through the commands and objects previously created.

Here's an excerpt from the Brahman v1 "Bart Simpson" game:

; Prepositions
create "to" as preposition.
create "up" and "down" as prepositions.
create "with" as preposition.

; Pseudo prepositions.
create implicit "north_of", implicit "east_of", implicit "west_of" and implicit "south_of" as prepositions.

; abstractions.
create "north", "east", "south", "west".
create "w", "e", "s", "n", "u", "d".

; Standard classes
create some implicit "clothes" as container.
create a "garment" in here.
create some "furniture" in here.
create a "seat" as furniture.
create a "chair" as seat.
create "gettable" in here.

; stock verbs.
create "pick" as verb.

; Look
create "examine", "look" and "l" as verbs.
look means think.
look in "X" means look "X".
look thing "X" means describe "X".
examine container "X" means (
	describe "X".
	if all in "X" then
		think "inside you find", all in "X"
)
look in container "X" means (
	if all in "X" then
		think "You find", all in "X"
	else think "There's nothing in there."
)
look on thing "X" means (
	if all on "X" then
		think "You find", all on "X"
	else think "There's nothing there."
)
look in "X" means look "X".
look at "X" means look "X".
examine "X" means look "X".
l "X" means look "X".


; Self movement operator
create "go" as verb.
go east means (
	if what is east_of here then
		put me in what is east_of here
	else think "There's no exit there."
)
go west means (
	if what is west_of here then
		put me in what is west_of here
	else think "There's no exit there."
)
go north means (
	if what is north_of here then
		put me in what is north_of here
	else think "There's no exit there."
)
go south means (
	if what is south_of here then
		put me in what is south_of here
	else think "There's no exit there."
)

w means go west
e means go east
s means go south
n means go north
u means go up.
d means go down.

east means go east
south means go south
west means go west
north means go north.

; Give X to Y.
create "give" as verb.
give "X" to mobile "Y" means (
	if "X" in "Y" then 
		think "Y", " already has", "X"
	else
		if "X" in me then (
			silent.
			if put "X" in "Y" then (
				loud.
				think "Y", " thanks you."
			) else loud
		) else think "But you don't have", "X"
)


; Get
create "get" and "take", "carry" as verbs.
get "X" means think "No way man!".
get gettable "X" means (
	if "X" in me then
		think "You've already got", "X"
	else (
		silent.
		if put "X" in me then (
			loud.
			think "You get", "X"
		) else loud
	)
)
take "X" means get "X".
carry "X" means get "X".		
pick up "X" means get "X".
pick "X" means get "X".

; Drop
create "drop" as verb.
drop thing "X" means (
	if "X" in me then (
		silent.
		put "X" in here.
		loud.
		think "You drop", "X"
	)
	 else think "But you're not carrying", "X"
)

; Wear.
create "wear" as verb.
wear garment "X" means (
	if "X" in clothes then 
		think "You're already wearing", "X"
	else (
		silent.
		if put "X" into me then (
			put "X" into clothes.
			loud.
			think "you put on", "X"
		)		
		else (loud. think "You can't")
	)
)
		
; Remove.
create "remove" as verb.
remove garment "X" means (
	if "X" in clothes then (
		silent.
		put "X" in me.
		loud.
		think "You take off", "X"
	)
	else think "You're not wearing", "X"

)

; Sit
create "sit" as verb.
sit down means (
	if a seat in here then
		think a seat in here, a "catches your eye."
	else
		think "There's nothing to sit on here."
)

sit on seat "X" means think "You sit on", "X".

; other verbs.
create "open" and "close" as verbs.
create "shut" as verb.
create "climb" and "descend" as verbs.
shut "X" means close "X".
climb "X" means go "X".
descend "X" means go "X".
create "mess" as verb.
create "untidy" as verb.
untidy "X" means mess "X".
mess up "X" means mess "X".
create "eat" as verb.
create "write", "scrawl" and "paint" as verbs.
write on "X" means write "X".
scrawl on "X" means write "X".
paint "X" means write "X".
create "trample" as verb.
create "dance", "party" as verbs.

dance means think "You boogie on down by yourself, don't drop a cow man!"
dance with mobile "X" means think "X", " doesn't want to dance with you!".

; The representitve classes

create some "people" as mobiles.
create a "place" as a container.
create a "wall" as a place.
create a "room" as a wall.
create "garment" in here.

; Create the locations.

create a "hall" as a room.
create (a "kitchen" as a room) north_of the hall.
put the hall south_of the kitchen.
create (a "lounge" as room) west_of hall.
put the hall east_of the lounge.
set hall as "Man! this hall needs brightening. East is your parent's bedroom and west is the lounge.".
set lounge as "This is the room in which the rest of the family waste most of their time."

create (a "sofa" as seat) in lounge.

create (a "garden" as a place) south_of the hall.
set garden as "The garden and its [flowers](look flower) are the pride and joy of Mr. Simpson (senior). Northwards is the front [door](open door)."

create a "flower" in here.
create an "orchid" as flower and gettable.
create ((a "flower" "bed" as container) of flower) in garden.
put orchid in flower bed.
set orchid as "The single flower is a rare [orchid](pick flower), cultivated with great care and attention."
set flower bed as "Your father has told you many times NEVER to touch this flower bed."

create "front" as adjective.
create a front "door" in garden.
set front door as "This door is just not hip!".

create "Simpson" as people.
create a "dude" as people.
create "radical" as adjective.

create (radical "Bart" as Simpson and dude) in garden.
set bart as "Yo! A radical dude!"

create "muddy" as adjective.
create a muddy "patch" in universe.
set muddy patch as "There's only a muddy patch where the prim flower bed used to be."

create implicit "deep", implicit "serious" and implicit "dead" in here.
create implicit "_trouble" as container.

create "score" as verb.
score means (
	if all in _trouble then
		think "You're in ", all in _trouble, a " trouble!"
	else
		think "You're still in your folks' good books."
)


create implicit "master" as adjective.
create (master "your parent's" "bedroom" as room) east_of hall.
put hall west_of master bedroom.

create a "landing" as room.
set landing as "Yo dude! You're on the threshold of your own domain to the east, oh yea, and Lisa's rotten old room is to the west."

create "small" as adjective.
create (small "your" "bedroom" as room) east_of landing.
put landing west_of small bedroom.
create "fluorescent" as adjective.
create (a fluorescent "marker" as gettable) in here.
set marker as "Wow! this marker's bright!".

create some "stairs" in hall.

create implicit "rotten" and implicit "old" as adjectives.
create "Lisa" as people.

create ((rotten old "Lisa's" "bedroom" as room) of Lisa) west_of landing.
put landing east_of rotten bedroom.
create (a "cupboard" as container) in rotten bedroom.

set small bedroom as "Oh no, your mother has TIDIED all your things, you'll never find anything now."

set master bedroom as "Your parents keep valuable breakables in here. This room is out of bounds as far as you are concerned."

set rotten bedroom as "Lisa's bedroom is neat and tidy as usual."

create "cool" and implicit "my" as adjectives.
create (some cool "shades" as garment and gettable) in small bedroom.
create (some my "shorts" as garment and gettable) in clothes.

; Specials

go flower bed means (
	think "You trample the flower bed with your big feet - Oh No!".
	if flower in flower bed then (
		think " You trample the rare orchid too. You're in deep trouble!".
		silent.
		put deep in _trouble.
		put flower in universe. loud).
	silent.
	if all in flower bed then put all in flower bed into garden.
	put flower bed in universe.
	put muddy patch in garden.
	loud
)
trample flower bed means go flower bed.
trample on flower bed means go flower bed.

open front door means (
	if what is north_of here then
		think "The door is already open."
	else (
		silent.
		put the hall north_of the garden.
		put the garden south_of the hall.
		loud.
		think "You open the front door."
	)
)

close front door means (
	if what is north_of here then (
		silent.
		put the hall not north_of the garden.
		put the garden not south_of the hall.
		loud.
		think "You close the door."
	)
	else think "The door isn't open."
)

go stairs means (
	if stairs in hall then (
		silent.
		put me and the stairs into landing.
		loud.
		think "you climb the stairs."
	)
	else (
		silent.
		put me and the stairs into hall.
		loud.
		think "you descend the stairs."
	)
)

go up means (
	if me in hall then go stairs
	else think "There's no way up here."
)

go down means (
	if me in landing then go stairs
	else think "There's no way down here."
)

mess small bedroom means (
	think "You sprawl your junk around the room as usual.".
	set small bedroom as "Your bedroom is a total mess!".
	silent. put marker in here. loud
)

write "hall" means (
	if marker in me then (
		think "You scrawl \"LISA\" in large letters - that's better, this is serious trouble!".
		set hall as "This hall is decorated in much more your style.".
		silent. put serious in _trouble. loud
	)
	else think "You don't have anything to write with."
)

create an implicit "cow" in bart.
drop cow means think "No way man!".

create (a "vase" as gettable) in master bedroom.
drop vase means (
    if vase in me then (
		think "The vase shatters into pieces. Your in dead trouble now!".
		silent.
		put dead into _trouble.
		put vase in universe.
		loud
	)
	else think "You don't have no vase!"
)

put _trouble and clothes into bart.
become Bart.

; Inventory operator.
create "inventory", "inv", "i" as verbs.
i means (
	if all in me then
		think "You are carrying", all in me
	else think "You are empty handed."
)
inventory means i.
inv means i.

eat shorts means (
     think "Yo Dude, you eat your OWN shorts!".
	 silent. put shorts in universe. loud
)

Although an interesting idea in priciplem, the concept of using the game's own parser to create itself becomes a burden and over-complex.

The "Strand" IF system is a kind of "version 2" Brahman, developed in 2018. Now the word "Brahman" has been dropped since the game is no longer created within itself. Instead the Strand objective is to simplify game creation by introducing a DSL that is very light on syntax.

Here is COD in Strand:

/////////////// COD game file

BEGIN
GOFOYER
MAIN

//////////////////////////////////////////////////////////

// this is set when you mess up in the dark
YOULOSE

ISNOTDARK > is CLOAK with here
* yes
no
*
yes

CLOAK@ GARMENT
> put it on player
* name
the black velvet cloak
* x it
It's a black velvet cloak.
* feel it
It's soft.

HOOK@ SURFACE
> put it in CLOAKROOM
* name
the brass small hook
* x it
It's a small brass hook.
> x it

MESSAGE@ THING
> put it in BAR
* name
the message
* x it
XMESSAGE
* see it
There's a message written on the floor here.

XMESSAGE
The message reads, "XMESSAGE1"

XMESSAGE1=
*?YOULOSE You have lost.
* You have won.

//////////////////////// the cloakroom ///////////

XCLOAKROOM
You are in the cloakroom.

CLOAKROOM@ INSIDE
* name
the cloakroom
* x it
XCLOAKROOM
* e
GOFOYER
*+!= go to FOYER
GOFOYER

GOCLOAKROOM
> put PLAYER in CLOAKROOM
XHERE

//////////////////////// the bar ///////////

XBAR
You are in the bar.

BAR@ INSIDE
* name
the bar
* x it
XBAR
* n
GOFOYER
*+!= go to FOYER
GOFOYER

GOBAR
> put PLAYER in BAR
XHERE

//////////////////////// the foyer ///////////

XFOYER
You are in the foyer.

FOYER@ INSIDE
* name
the foyer
* x it
XFOYER
* s
Gobar
*+!= go to BAR
GOBAR
* w
GOCLOAKROOM
*+!= go to CLOAKROOM
GOCLOAKROOM

GOFOYER
> put PLAYER in FOYER
XHERE

Strand Games has developed the Strand IF language and runtime. This system is no longer beta but is not ready for new users since documentation is lacking.

Nevertheless the system is free and open source.