TWIRThie stands for Tree-Walker of Intrusive, Repetitive Thoughts. Twirthie is a website and Android game that has to do with my positive symptom of schizophrenia: having intrusive, repetitive thoughts. I haven't actually begun implementing the game yet. The website will (at first) be implemented entirely in HTML and JavaScript. Click on Downloads to view the Downloads web page, to download a Java program that runs on Windows, Mac, and Linux. The Java program displays random sentences similar to my intrusive/repetitive thoughts.
The website has a Generate button and a thought counter (which defaults to N = 1) at the top of the screen. Pressing Generate/Refresh displays N random sentences which all belong to my grammar of crazy thoughts. (The next paragraph not yet implemented, and when it does get implemented please skip rest of this paragraph.) All words/tokens are displayed in black, except the current word/token is displayed in red. Pressing left/right arrow selects adjacent word/token. Pressing up arrow goes to a higher level in the syntax tree. Pressing down arrow on a token beginning with a dollar sign ($) expands that token.
Tree-Walker
In normal mode, all words/tokens are displayed in black, except the current word/token is displayed in red. Pressing up arrow takes the user to rule mode, in which the enclosing rule is enclosed in red angle brackets (pressing up arrow again goes higher in the syntax tree). Pressing down arrow on a token beginning with a dollar sign ($) expands that token, going into rule mode and using the first rule (or maybe the current rule). When in rule mode, pressing right/left arrow cycles through the available rules. Pressing up arrow goes higher in the syntax tree. Pressing down arrow takes the user to normal mode, highlighting the first word/token in the current rule (unless the current rule contains one or more optional blocks, in which case the user is taken to block mode). In block mode, all optional blocks are enclosed in black square brackets, except the current optional block is enclosed in red square brackets. Pressing the space bar toggles the current optional block to be normal or empty (containing no words/tokens). Pressing right/left arrow cycles through the available optional blocks. Pressing up arrow takes the user back to rule mode. Pressing down arrow takes the user to normal mode.
Smartphone Game
The object of the Android game (which is a free download) is to parse the target sentence which belongs to my grammar of crazy thoughts and is displayed at the bottom of the screen. Random words/non-terminal symbols slowly fall down from the top of the screen and your job is to parse the target sentence (beginning with the start symbol: <sentence>). Whenever a falling word/symbol matches what you're currently parsing, it disappears and you get points (more points if multiple words/symbols are falling). If a falling symbol reaches the bottom your energy level is eroded. When the target sentence is completely parsed, a new sentence appears. Users can edit the default grammar or create a brand-new grammar, and upload those grammars to twirthie.com so other users can download them and parse those grammars within my game.
When parsing the target sentence, tapping a word matches a falling word (if any), and dragging a non-terminal symbol upwards displays a list of lower-level grammar elements. Tapping a list element selects it. Dragging a word/non-terminal symbol downwards displays a higher-level non-terminal symbol. Many details of the game have yet to be worked out.
NetLyve
One of the main goals of the Twirthie project is to act as a test bed for a much more ambitious project called NetLyve. This second project features 2 new computer languages, Lyvathon and Lyvatags, which are dialects of Python and HTML, respectively. NetLyve is a tool for creating web-based apps/games as well as Android apps and is implemented using Java. The Twirthie website will be converted into Lyvathon and Lyvatags, and the corresponding Android game will be converted into those 2 languages as well. Lyvatags does double duty as a screen layout language.
Partial Grammar
- <sentence>
- <subjtps><vpso>
- <subjntps><vpo>
- <subj><vpedo>
- <subj> will <vpo>
- <subjtps> has <vpedo>
- <subjntps> have <vpedo>
- <subjtps><vis><voap>
- <subjfps><vam><voap>
- <subjsps><vare><voap>
- <subjxpp><vare><voap>
- <voap> verb-obj-adj-phrase
- <vping><op>
- going to <vp><op>
- <ap>
- <vpo> verb-phrase-obj
- <vp><op>
- <vlike>
- <vpso>
- <vps><op>
- <vlikes>
- <vpedo>
- <vped><op>
- <vliked>
- <vb> verb
- kill
- torture
- harm
- mangle
- hate
- punish
- vandalize
- crush
- <person>
- God
- Christ
- the President
- the Vice-President
- the Vice-Regal Chancellor of the Exchequer
- Harold
- Reginald
- Edgar
- the postman [<ofp>]
- the Son of God
- the Son of Christ
- <adj> folk
- <adj> people
- <objw> obj-word
- dog
- brain
- person
- dentist
- demagogue
- debacle
- pedagogy
- monster
- vandal
- bastard
- <adj> adjective
- violent
- evil
- wicked
- vicious
- deadly
- dead
- horrible
- terrible
- harsh
- severe
- <vbed>
- <vis> verb-is
- is
- has [advtime] been
- <vam>
- am
- have [advtime] been
- <vare>
- are
- have [advtime] been
- <advtime>
- always
- never
- <vlike> verb-like
- enjoy <vpingtd>
- like <vpingtd>
- like to <vptd>
- <vptd> verb-phrase-to-death
- <vp><ptd>
- <vp> verb-phrase
- [<advp>] <vb>
- <ptd> phrase-to-death
- <subj> [<advp>] [<td>]
- <td> to-death
- to death
- a great deal
Grammar in JSON Format
- <alike> adj-like
- like - 60%
- [<adv>] similar to - 0%
- [<adv> foo] similar to <bar> - 40%
- percentages:
- -1 = equal share of 100% less sum of +ve percentages
grammar = [ {sym: "$sentence", rules: [...]}, {sym: "$alike", rules: [ [60, "like"],... [-1, [50, "$adv", "foo"], "similar to", "$bar"] ]} ];
Grammar in .GRM Format
alike - this is a comment (after first space) 60 like 0 [$adv] similar to [$adv foo] similar to $bar adv - adverb violently brutally viciously bar - dummy symbol def foo $alike [80 $fubar] #1967 summer of love $fubar [#99 percenters][the 7 percent solution]
Comments:
- "alike" rules:
- first rule occurs with probability of 60 percent
- second rule is never used
- third rule occurs with probability of 40 percent
- optional phrase ($adv foo) occurs with probability of 50 percent
- $adv and $bar refer to 2 sets of rules called adv and bar
- "bar" rules:
- optional phrase ($fubar) occurs with probability of 80 percent
- #1967 is a numeric literal, pound (#) char. is ignored
- so is #99 (without the pound char. it would be treated as a percentage)
- optional phrase (the 7 percent solution) also has a numeric literal = 7
- don't write #7 since it's not the first element of the optional phrase
- both optional phrases are each included 50 percent of the time
- only 25 percent of the time are both optional phrases included
- $alike and $fubar refer to 2 sets of rules called alike (1st set of rules) and fubar
About Me
I am Mike Hahn, the founder of Twirthie.com. On August 9, 2014 I began working on Basyx.org (a tutoring website). I started developing Lyvathon.org (a new programming language) on January 4, 2015, after dabbling in its precursors (sporadically) since the mid 90s. On January 24, 2015 I resumed working on Basyx.org, and resumed working on Lyvathon on May 9, 2015. I started designing Lyspio.com (the master website of all Lyvathon apps) on November 16, 2015. I started PlicTalk.com, an image collection manager, on January 13, 2016. One month later I started NetLyve.com (used to be Lyspio.com) on February 15, 2016. I started Twirthie on March 24, 2016 (based on an earlier idea I fleshed out in 1987).
I was previously employed at Brooklyn Computer Systems as a Delphi Programmer and a Technical Writer (I worked there between 1996 and 2013). Just prior to starting Lyvathon I quit my job as a volunteer tutor at Fred Victor on Tuesday afternoons, where for 5 years I taught math, computers, and literacy. I'm now a volunteer computer tutor at West Neighbourhood House. My hobbies are reading the news at cbc.ca and going for walks in my neighbourhood. About twice a year I get together with my sister who lives in Victoria. She comes here or I go out there usually in the summer. At those times I'm much more active, but most of the year I tend to lie on the couch a lot, and not be very active. I do, however, visit my brother once a month or so and correspond with my pen-pal, who lives in England.
Contact Info
Mike Hahn
Founder
Twirthie.com
2495 Dundas St. West
Ste. 515
Toronto, ON M6P 1X4
Canada
Phone: 416-533-4417
Email: hahnbytes (AT) gmail (DOT) com
Blog: lyvathon.blogspot.ca