Professional Documents
Culture Documents
Introduction
7thlanguage is script language that create short story automatically. I have designed and developed this 7thlanguage by myself. 7thlanguage has minimal functions for the generation of short story. It had not functions like sound and graphics, or interactive operation. But it has many kind of inventions for the generation of short story. 7thnovel has not "STOP" instruction, or "JUMP" instruction, so 7thlanguge is very peculiar language. But many of programmers know well that these instructions sometimes cause tragedies. And also short story never loops 7thlanguage has no loop instruction. Source codes written in 7thlanguge are processed by 7thleader and create short stories actually. For the help of reader "source code" and "generated text" are written in different color.
-1 -
---------------------- 7threader English Version ----------------------Good morning. It's a fine day to day, isn't it. -------- 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.00 --------key word "title" means begining of story. "morning_greeting" after "title" is name of scenario. Following text Good morning. It's a fine day today, isn't it. is a contents of story. key word "end" means end of scenario block started by key word "title" messages ---------------------- 7threader English Version ------------------------------ 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.00 --------are automatically added by 7threader.
Comment
When the first colum of source code is ";", then this text line of source code is considered as comment line (sample2.7th) ;*********************** ;* What happened today * ;*********************** title go_to_University I went to University and had a lecture today. After lecture I had chatted with my friend end
-2 -
end title go_to_movie I went go movie with my friend. After watching movie we went Italian restaurant. end title go_to_picnic I went to picnic with my friends. Cherry blossoms were very beautiful. Many boys had joined from another university. end Then each story will be displayed random.
Parts of scenario
Parts of scenario except entry point of story are described using "scene" instruction. example scene invited_to_a_party I was invited to a party when I was going back home. We all entered a tavern just near the station. end scene drink_at_tavern Inside the tavern was decorated like folk handicraft style. Boys are seems to be often here to have a drink. end name of scene must be given to distinguish each scene. scenes are called from another scenes statement or title statement. sample4.7th title go_to_picnic I went to picnic with my friends. Cherry blossoms were very beautiful. Many boys had joined from another university. {invited_to_a_party} {drink_at_tavern} end control of program is return to caller like subroutine in c language. But "return" statement is not defined at 7thlanguage. So control will return only when it comes the end of scene statements. Null statement cannot be defined. scene invited_to_a_party I was invited to a party when I was going back home. We all entered a tavern just near the station.
-3 -
end this statements are not allowed. and also null statement like scene invited_to_a_party end is not allowed
Chapter number
Chapter number is defined preliminary as scene statement. Name of Chapter number is defined as "No". Chapter number is used as follows. sample5.7th title go_to_picnic {No} I went to picnic with my friends. Cherry blossoms were very beautiful. Many boys had joined from another university. {No} {invited_to_a_party} {drink_at_tavern} end Result texts are following ---------------------- 7threader English Version -----------------------
1. I went to picnic with my friends. Cherry blossoms were very beautiful. Many boys had joined from another university. 2. I was invited to a party when I was going back home. We all entered a tavern just near the station. Inside the tavern was decorated like folk handicraft style.
-4 -
Boys are seems to be often here to have a drink. -------- 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.01 ---------
Continuous line
To connect two or more lines use \ charactor at the end of each line.
-5 -
sample9.7th title go_to_picnic I went to picnic with my friends. Cherry blossoms were very beautiful. Many boys had joined from another university, \ but I didnt know any of them. end are considered as same source code as title go_to_picnic I went to picnic with my friends. Cherry blossoms were very beautiful. Many boys had joined from another university, but I didnt know any of them. end
-6 -
Cherry blossoms were very beautiful. Many boys had joined from another university, but I didnt know any of them. -------- 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.00 ---------
-7 -
---------------------- 7threader English Version ----------------------I went to picnic with my friends. Cherry blossoms were very beautiful. Many boys had joined from another university, but I didn't know any of them. -------- 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.00 ---------
Select statement
To select a scene from given scenes use select statement. Select statement is described as follows sample25.7th scene invited_to_party I was invited to a party. end scene invited_to_drink I was invited to have a drink end select case_of_intivitaion invited_to_partiy invited_to_drink end title I_had_drunk {case_of_invitation} I had drunk too much and could not walk alone. end "case_of_invitation" is a name of select statement. "invited_to_party" and "invited_to_drink" are name of scene that are to be selected. Method To call select statment is same as to call scene statment as follows. {case_of_invitation} and control is return to caller as subroutine. 7threader generate two cases as follows ---------------------- 7threader English Version ----------------------I was invited to a party. I had drunk too much and could not walk alone. -------- 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.00 ------------------------------ 7threader English Version ----------------------I was invited to have a drink I had drunk too much and could not walk alone. -------- 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.00 ---------
-8 -
Character variable
7thlanguage can use character variable sample26.7th title meet_friend_at_ceremony When entrance ceremony was finished I was called by a girl who was next at the entrance examination. [My friend=Reiko] Her name was [My friend] and wearing colorful one piece. end Using this source code 7threader generate texts as follows ---------------------- 7threader English Version ----------------------When ceremony was finished I was called by a girl who was next at the entrance examination. Her name was Reiko and wearing colorful one piece. -------- 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.00 --------"My friend" is a name of character valuable. Statement "[My friend=Reiko]" means substitute a character value "Reiko" for the valuable "My friend"; This statement indicate a substitution only and do not displayed it self when 7thleader generate text. Variable "My friend" does not need to be declared preliminary. Null character can be substituted like [My freiand=] and this means Variable "My friend" has null value. Also value "My friend" has null value when substitution is not executed. When the Value of character valuable is null then 7thleader displays value name instead of null value. sample27.7th title having_a_tea I and [My friend] entered the tea room near the University after entrance ceremony. end Using this source code 7thleader generate texts as follows ---------------------- 7threader English Version ----------------------I and My friend entered the tea room near the University after entrance ceremony.
-9 -
-------- 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.00 ---------
In this case parentheses are processed when character variable "my friend" is displayed its value. So It may have different value each time when it displayed.
10 -
Numeric variable
7thlanguage can use Numeric variable. Numeric values are stored as double precision. Floating and integer values are also stored as double precision. Name of numeric value is start with % character as follows %age of my friend Numeric variable can display its value using [] as follows [%age of my friend] Calculation can be done like C language but method of calculations is restricted at the moment and can use following formulas only. values showed below 10 can changed with another value [%age of my friend++] [%age of my friend--] [%age of my friend+=10] [%age of my friend-=10] Numeric variable does not have counter of it self like character variable. sample30.7th title age_of_my_friend [%age of my friend=18] My friend is [%age of my friend] years old. [%age of my friend++] My friend well be [%age of my friend] years old next year. [%age of my friend=20] My friend is [%age of my friend] years old. [%age of my friend--] My friend was [%age of my friend] years old last year.
11 -
end ---------------------- 7threader English Version ----------------------My friend is 18 years old. My friend well be 19 years old next year. My friend is 20 years old. My friend was 19 years old last year. -------- 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.00 --------sample31.7th title age_of_my_friend [%age of my friend=18] My friend is [%age of my friend] years old. [%age of my friend+=10] My friend well be [%age of my friend] years old ten years later. [%age of my friend=20] My friend is [%age of my friend] years old. [%age of my friend-=10] My friend was [%age of my friend] years old ten years ago. end ---------------------- 7threader English Version ----------------------My friend is 18 years old. My friend well be 28 years old ten years later. My friend is 20 years old. My friend was 10 years old ten years ago. -------- 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.00 ---------
12 -
sample33.7th title meet_friend_at_ceremony When ceremony was finished I was called by a girl who was next at the entrance examination. Her[my friend=Reiko] name was [my friend] and introduced me her friend[my friend=Yosie] [my friend] coming with her. end ---------------------- 7threader English Version ----------------------When ceremony was finished I was called by a girl who was next at the entrance examination. Her name was Reiko and introduced me her friend Yosie coming with her. -------- 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.00 ---------
When entrance ceremony was finished I was called by a girl. Her[my friend=Reiko|Sanae] name was [my friend] who was next at entrance examination. [my friend] had dressed in colorful one piece. When entrance ceremony was finished I was called by a girl. She was[my friend=Yosie|Midori] senior who lives next door to my apartment. [my friend] had dressed in colorful one piece. and then substitution is processed next time as follows ---------------------- 7threader English Version ----------------------When entrance ceremony was finished I was called by a girl. Her name was Reiko who was next at entrance examination. Reiko had dressed in colorful one piece.
13 -
-------- 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.00 ------------------------------ 7threader English Version ----------------------When entrance ceremony was finished I was called by a girl. She was senior who lives next door to my apartment. Midori had dressed in colorful one piece. -------- 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.00 ---------
Condition formula
Condition formula can be used using variable sample35.7th title meet_friend_at_ceremony When entrance ceremony was finished I was called by a girl. Her[my friend=Reiko] name was [my friend] who was next at entrance examination. {Dress_of_my_friend} end scene Dress_of_my_friend She <my friend==Reiko>dressed in colorful one piece<my friend==Sanae>dressed in sober blue suit; and looked merrily. end ---------------------- 7threader English Version ----------------------When entrance ceremony was finished I was called by a girl. Her name was Reiko who was next at entrance examination. She dressed in colorful one piece and looked merily. -------- 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.00 --------condition formula <my friend==Reiko> is true when value of "my friend" is Reiko. If true is judged following text next to this formula is displayed till next condition formula Another decision <my friend==Sanae> is true when value of "my friend" is Sanae. And if false then following text next to this formula does not displayed. ; means a cancel of decision. and following text next to ; are displayed Decision is processed form top to bottom of text. When condition formula had found, then value of condition was decided and if true display text following condition formula. When it reached next formula, value of condition was decided also. When it reached ";" character, it mean end of decision and following text are displayed normally.
14 -
15 -
friend==Yosie>I_went_apartment;I_went_back_my_apartment} end selece name_of_friend meet_with_Reiko meet_with_Yosie end scene meet_with_Reiko [my friend=Reiko] Her name was [my friend] and dressed in colorful one piece end scene meet_with_Yosie [my friend=Yosie] Her name was [my friend] and wearing plain blue suit. end scene I_went_condominium I went her condominium with her. Her room was very timid and decorated with colorful furniture. end scene I_went_apartment I went her apartment with her. She prepared me a cup of tea. end scene I_went_back_my_apartment I went back my apartment and have a tea. end Above source code {<my frien==Reiko>I_went_condominium<my friend==Yosie>I_went_apartment;I_went_back_my_apartment} is a source code using condition formula. Condision fomula of this source code is <my friend==Reiko> <my friend==Yosie> In this condisioned scene calling statement, only on scene is called. 7threader searches conditions from top to bottom of text line. When it found condition of True value it calls scene next to condition. Then process of this line is over, and another conditions following first true condition are not evaluated or executed.
Expression of condition
Expression of condition is allowing following expression at the moment. Case of character variable <my friend==Reiko> True if value of "my friend" is Reiko
16 -
<my friend!=Reiko> True if value of "my friend" is not Reiko <my friend==> True if value of "my friend" is null or not defined. <my friend!=> True if value of "my friend" is not null of defined. Case of Counter of character variable <$my friend==5> <$my friend!=5> <$my friend<=5> <$my friend>=5> Case of numeric variable <%age of my friend==22> <%age of my friend!=22> <%age of my friend<=22> <%age of my friend>=22> Select with condition
17 -
Her name was [my friend] and dressed in colorful one piece. end scene meet_with_Yosie [my friend=Yosie] Her name was [my friend] and wearing plain blue suit. end scene I_went_condominium I went her condominium with her. Her room was very timid and decorated withe colorful furniture. end scene I_went_apartment I went her apartmen with her. She prepared me a cup of tea. end scene I_went_back_my_apartment I went back my apartment and have a tea. end above example <my friend==Reiko> <my friend==Yosie> are condition formula in case of select statement. If condition is false then this scene will not selected and if condition is true t hen this scene will be candidate of selection.
18 -
Her name was [my friend] and dressed in colorful one piece. end scene meet_with_Yosie [my friend=Yosie] Her name was [my friend] and wearing plain blue suit. end scene I_went_condominium I went her condominium with her. Her room was very timid and decorated with colorful furniture. end scene I_went_apartment I went her apartmen with her. She prepared me a cup of tea. end scene I_went_back_my_apartment I went back my apartment and have a tea. end scene I_went_to_tea_room We went tea room near the University. end scene I_went_shopping We went shopping near her apartment. end If condition <my friend==Reiko> is true then select statement is same as following. select after_ceremony I_went_condominium I_went_to_tea_room I_went_back_my_apartment end If condition <my friend==Yosie> is true the select statement is same as following select after_ceremony I_went_apartment I_went_shopping I_went_back_my_apartment end
Inhibiton of scene
Scene can be inhibited its excution using ! as follows. sample41.7th
19 -
title meet_friend_at_ceremony {!meet_with_Reiko} When entrance ceremony was finished I was called by a girl who was next at entrance examination. {meet_with_Reiko} {meet_with_Yosie} end scene meet_with_Reiko [my friend=Reiko] Her name was [my friend] and dressed in colorful one piece. end scene meet_with_Yosie [my friend=Yosie] Her name was [my friend] and wearing plain blue suit. end ---------------------- 7threader English Version ----------------------When entrance ceremony was finished I was called by a girl who was next at entrance examination. Her name was Yosie and wearing plain blue suit. -------- 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.00 --------In this case {!meet_with_Reiko} Does not call scene "meet_with_Reiko" but inhibit its excution. using # like this {#meet_with_Reiko} inhibition is canceled.
Priority in select
If you want to level up priority of certain scene in select statement use &+ command like following sample42.7th title meet_friend_at_ceremony When entrance ceremony was finished I was called by a girl who was next at entrance examination. {meet_with_Reiko} {&+I_went_back_my_apartment} {after_ceremony} end select after_ceremony I_went_condominium I_went_apartment I_went_back_my_apartment
20 -
end scene meet_with_Reiko [my friend=Reiko] Her name was [my friend] and dressed in colorful one piece. end scene I_went_condominium I went her condominium with her. Her room was very timid and decorated with colorful furniture . end scene I_went_apartment I went her apartment with her. She prepared me a cup of tea. end scene I_went_back_my_apartment I went back my apartment and have a tea. end In this case {&+I_went_back_my_apartment} this statement increase priority of scene "I_went_back_my_apartment" So in select statement this scene will be selected primarily. When this statement is used many times, priority is increase one level each time. To decrease priority use {&-I_went_back_my_apartment} Default value of priority is zero. Also priority not be allowed to be under zero.
Reset of flags
Short stories can be regenerated repeatedly using 7threader. At each time of regeneration, variables and flags are all initialized. Also inhibition flag and priority of scene are reset. No date could be taken over from former short story to its descendant.
Counter of scene
Each scene and select statement has its own counter. These counters are counted up each time when scene and select statement are called. Counters are saved for each scenario files. When scenario name is "test.7th" then Counter data file is saved as "test.7da" This counter has effect on select statement. Select statement will select scene primarily that has minimum counter value.
21 -
So select statement is executed as following steps. 1. Discriminate scene that had inhibited by ! command. 2. Judge condition formula and discriminate if its value is false 3. Select scene that had maximum priority. 4. Select scene which have minimum counter value. 5. Select randomly from candidate selected above.
22 -