456
edits
mNo edit summary |
mNo edit summary |
||
Line 64: | Line 64: | ||
Below is a Program I have written that takes some of sciences dogmas today and by clicking your mouse you can mix up the original sentences by changing at random the Subject, descriptor and object, creating new dogmas, some that don't make compete grammatical sense. Yet. | Below is a Program I have written that takes some of sciences dogmas today and by clicking your mouse you can mix up the original sentences by changing at random the Subject, descriptor and object, creating new dogmas, some that don't make compete grammatical sense. Yet. | ||
<html><body><pre> | |||
<span style="color: #666666;">//Declare</span> | |||
<span style="color: #E2661A;">String</span> sentence1; | |||
<span style="color: #666666;">//eleven</span> | |||
<span style="color: #E2661A;">String</span>[] oBject = { | |||
<span style="color: #7D4793;">" mechanical"</span>, <span style="color: #7D4793;">" a machine"</span>,<span style="color: #7D4793;">" fixed"</span>, <span style="color: #7D4793;">" unconscious"</span>, <span style="color: #7D4793;">" nature"</span>, <span style="color: #7D4793;">" purpose"</span>, <span style="color: #7D4793;">" genes"</span>, <span style="color: #7D4793;">" brain"</span>, <span style="color: #7D4793;">" mind"</span>, <span style="color: #7D4793;">" head"</span>, <span style="color: #7D4793;">" impossible"</span>, <span style="color: #7D4793;">" that really works"</span> | |||
//Declare | |||
String sentence1; | |||
//eleven | |||
String[] oBject = { | |||
}; | }; | ||
//twelve | <span style="color: #666666;">//twelve</span> | ||
String[] descriptor = { | <span style="color: #E2661A;">String</span>[] descriptor = { | ||
<span style="color: #7D4793;">"is"</span>, <span style="color: #7D4793;">"is like"</span>, <span style="color: #7D4793;">"is"</span>, <span style="color: #7D4793;">"are "</span>, <span style="color: #7D4793;">"has no"</span>, <span style="color: #7D4793;">"is in your"</span>, <span style="color: #7D4793;">"are stored in your"</span>, <span style="color: #7D4793;">"is in your"</span>, <span style="color: #7D4793;">"is the activity of your"</span>, <span style="color: #7D4793;">"are"</span>, <span style="color: #7D4793;">"is the only type"</span>, <span style="color: #7D4793;">"are in"</span> | |||
}; | }; | ||
//thirteen | <span style="color: #666666;">//thirteen </span> | ||
String[] subject = { | <span style="color: #E2661A;">String</span>[] subject = { | ||
<span style="color: #7D4793;">"Nature "</span>, <span style="color: #7D4793;">"The universe "</span>, <span style="color: #7D4793;">"Matter "</span>, <span style="color: #7D4793;">"The laws of nature "</span>, <span style="color: #7D4793;">"The total amount of matter & energy "</span>, <span style="color: #7D4793;">"Evolution "</span>, <span style="color: #7D4793;">"Everything you inherit "</span>, <span style="color: #7D4793;">"Memories "</span>, <span style="color: #7D4793;">"Your brain "</span>, <span style="color: #7D4793;">"Your mind "</span>, <span style="color: #7D4793;">"Your consciousness "</span>, <span style="color: #7D4793;">"Psychic phenomena "</span>, <span style="color: #7D4793;">"Mechanistic medicine "</span> | |||
}; | }; | ||
<span style="color: #33997E;">void</span> <span style="color: #006699;"><b>setup</b></span>() { | |||
<span style="color: #006699;">size</span>(800, 250); | |||
<span style="color: #006699;">background</span>(0, 15, 108); | |||
<span style="color: #006699;">fill</span>(0); | |||
<span style="color: #006699;">smooth</span>(); | |||
} | } | ||
<span style="color: #33997E;">void</span> <span style="color: #006699;"><b>draw</b></span>() { | |||
<span style="color: #006699;">frameRate</span>(10); | |||
<span style="color: #E2661A;">int</span> i; | |||
<span style="color: #669900;">if</span> (<span style="color: #D94A7A;">mousePressed</span>) { | |||
<span style="color: #006699;">background</span>(0, 15, 108); | |||
<span style="color: #669900;">for</span> (i=0; i <= 2; i++) { | |||
<span style="color: #E2661A;">int</span> random[] = { | |||
<span style="color: #006699;">int</span>(<span style="color: #006699;">random</span>(subject.<span style="color: #33997E;">length</span>)), | |||
<span style="color: #006699;">int</span>(<span style="color: #006699;">random</span>(descriptor.<span style="color: #33997E;">length</span>)), | |||
<span style="color: #006699;">int</span>(<span style="color: #006699;">random</span>(oBject.<span style="color: #33997E;">length</span>)), | |||
}; | |||
<span style="color: #006699;">fill</span>(255); | |||
<span style="color: #006699;">textAlign</span>(<span style="color: #718A62;">CENTER</span>); | |||
<span style="color: #006699;">textSize</span>(18); | |||
<span style="color: #E2661A;">int</span> sentence1PosY = 40+80*i; | |||
sentence1 = subject[random[0]] + descriptor[random[1]] + oBject[random[2]]; | |||
<span style="color: #006699;">text</span>(sentence1, <span style="color: #D94A7A;">width</span>/2, sentence1PosY); | |||
} | |||
} | |||
<span style="color: #669900;">else</span> { | |||
<span style="color: #006699;">redraw</span>(); | |||
} | |||
} | } | ||
</pre></body></html> | |||
[[Category:Initial Beginnings]] | [[Category:Initial Beginnings]] |
edits