Skip to content

Instantly share code, notes, and snippets.

@schuyler1d
Created March 29, 2015 03:00
Show Gist options
  • Save schuyler1d/fc748bdb98cfd1774920 to your computer and use it in GitHub Desktop.
Save schuyler1d/fc748bdb98cfd1774920 to your computer and use it in GitHub Desktop.
If you are not familiar with Queneau's unusual book Exercises in Style, then visit: http://www.amazon.com/Exercises-Oneworld-Classics-Raymond-Queneau/dp/1847490735#reader_1847490735 and read the first few pages. He tells the same brief story many times, all in different ways. This is an exercise in representing the same story, but in code.
"""
Notation, from _Exercises in Style_ by Raymond Queneau
-----------------------------------------------------------
On the S bus, in the rush hour, A chap of about twenty-six,
soft hat with a cord instead of a ribbon, neck too long,
as if someone's been tugging at it. People getting off.
The chap in question gets annoyed with one of the men
standing next to him. He accuses him of jostling him every
time anyone goes, past. A snivelling tone which is meant
to be aggressive. When he sees a vacant seat he throws
himself onto it.
Two hours later, I come across him in the Cour de Rome, in
front of the Gare Saint-Lazare. He's with a friend who's
saying: "You ought to get an extra button put on your
overcoat." He shows him where (at the lapels) and why.
"""
import people
from timedescriptions import rushhour, recurring, then, timedelta as Later
chap = people.Person(age=people.age_estimate(26),
clothes=[people.clothes.Hat(cord=True,
ribbon=False)],
physique=[people.physique.Neck(long=3)])
man = people.Person(gender=people.gender.Male())
sbus = people.Describable(name='S bus', time=rushhour(),
riders=people.group().including([chap, man]),
seats_available = [])
friend = people.Person(friends=[chap])
story = then(
[(sbus.riders, sbus.riders.get_off),
(chap, chap.accuse,
[man, man.jostle,
sbus, #on the sbus
recurring(sbus.riders, people.actions.go_past)]), #when
(sbus.seats_available, 1),
(chap, chap.throws_himself, sbus.seats_available.pop),
Later(hours=2),
(chap, chap.sitting, ['Cour de Rome', 'Gare Saint-Lazare']),
(friend, friend.say,
"You ought to get an extra button on your overcoat."),
(friend, friend.show(chap.clothes.lapel), chap),
]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment