Excuse Generator.

Share your advanced PureBasic knowledge/code with the community.
oToom
User
User
Posts: 54
Joined: Sat May 03, 2008 5:38 pm

Excuse Generator.

Post by oToom »

Code: Select all

;- Window Constants
;
Enumeration
  #Window_0
EndEnumeration

;- Gadget Constants
;
Enumeration
  #Button_0
  #Listview_0
EndEnumeration


OpenWindow(#Window_0, 327, 122, 277, 269, "oExcuse Generator",  #PB_Window_SystemMenu | #PB_Window_TitleBar |  #PB_Window_MinimizeGadget )
      ButtonGadget(#Button_0, 10, 10, 260, 30, "Generate")
      ListViewGadget(#Listview_0, 10, 50, 260, 210)


Dim Thing1.s(7)
  Thing1(0) = "My mom "
  Thing1(1) = "My dad "
  Thing1(2) = "My sister "
  Thing1(3) = "My brother "
  Thing1(4) = "My dog "
  Thing1(5) = "My cat "
  Thing1(6) = "The Police "
  Thing1(7) = "Mr.Bush "
  
Dim DidSomething.s(9)
  DidSomething(0) = "ate "
  DidSomething(1) = "burned "
  DidSomething(2) = "puked on "
  DidSomething(3) = "spat on "
  DidSomething(4) = "killed " 
  DidSomething(5) = "stabbed "
  DidSomething(6) = "washed "
  DidSomething(7) = "stole "
  DidSomething(8) = "blew up "
  DidSomething(9) = "shat on "
  
Dim Thing2.s(10)
  Thing2(0) = "my mom."
  Thing2(1) = "my dad."
  Thing2(2) = "my sister."
  Thing2(3) = "my brother."
  Thing2(4) = "my dog."
  Thing2(5) = "my cat."
  Thing2(6) = "the police."
  Thing2(7) = "Mr.Bush."
  Thing2(8) = "my homework."
  Thing2(9) = "my house."
  Thing2(10) = "my business."
  
  
    
Repeat
  Event = WaitWindowEvent()
  
  Select Event 
    Case #PB_Event_Gadget
      Select EventGadget()
        Case #Button_0
          Excuse$ = Thing1(Random(7)) + DidSomething(Random(9)) + Thing2(Random(10))
          AddGadgetItem(#Listview_0, -1, Excuse$)
        
      EndSelect
    Case #PB_Event_CloseWindow
      MessageRequester("oExcuse Generator", "Excuse generator created by oToom ( Ant )")
      Break
  EndSelect
ForEver

Creates simple, but funny excuses..
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

Cool i like it :D

But for use it all day, the list is perhaps too short, no ??? :roll:
Since tomorrow, i use it for my job :lol:

Thanks for sharing 8)
ImageThe happiness is a road...
Not a destination
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Post by dobro »

Kwaï chang caïne wrote:Cool i like it :D

But for use it all day, the list is perhaps too short, no ??? :roll:
Since tomorrow, i use it for my job :lol:

Thanks for sharing 8)
KCC
tu t'extasies devant un truc qui existe deja sur notre forum depuis le 26/11/2005 !!! :?


http://www.purebasic.fr/french/viewtopi ... ompositeur


that already exists on our forum since 26/11/2005!
:)
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

I'm not even bothering to look at this. Why? Because my dog shat on my brother! :lol: :lol: :lol:

Very funny idea, it could use some more variations, though.
User avatar
bobobo
Enthusiast
Enthusiast
Posts: 206
Joined: Mon Jun 09, 2003 8:30 am

Post by bobobo »

more variations? use properties !
I like the prominent position of Mr.Bush and inserting
elements in listview at the top

Code: Select all

;
;- Window Constants
;
;PB 4.30 (x86)
;
Enumeration
  #Window_0
EndEnumeration

;- Gadget Constants
;
Enumeration
  #Button_0
  #Listview_0
EndEnumeration


OpenWindow(#Window_0, 327, 122, 277, 269, "oExcuse Generator (V2)",  #PB_Window_SystemMenu | #PB_Window_TitleBar |  #PB_Window_MinimizeGadget )
ButtonGadget(#Button_0, 10, 10, 260, 30, "Generate")
ListViewGadget(#Listview_0, 10, 50, 260, 210)


Dim Thing1.s(7)
Thing1(0) = "My mom"
Thing1(1) = "My dad"
Thing1(2) = "My sister"
Thing1(3) = "My brother"
Thing1(4) = "My dog"
Thing1(5) = "My cat"
Thing1(6) = "The Police"
Thing1(7) = "Mr.Bush"

Dim DidSomething.s(9)
DidSomething(0) = "ate "
DidSomething(1) = "burned "
DidSomething(2) = "puked on "
DidSomething(3) = "spat on "
DidSomething(4) = "killed "
DidSomething(5) = "stabbed "
DidSomething(6) = "washed "
DidSomething(7) = "stole "
DidSomething(8) = "blew up "
DidSomething(9) = "shat on "

Dim Thing2.s(10)
Thing2(0) = "my mom."
Thing2(1) = "my dad."
Thing2(2) = "my sister."
Thing2(3) = "my brother."
Thing2(4) = "my dog."
Thing2(5) = "my cat."
Thing2(6) = "the police."
Thing2(7) = "Mr.Bush."
Thing2(8) = "my homework."
Thing2(9) = "my house."
Thing2(10) = "my business."

Dim props.s(10)
Props(0) = "little"
Props(1) = "big"
Props(2) = "damned"
Props(3) = "fucking"
Props(4) = "old"
Props(5) = "new"
Props(6) = "fat"
Props(7) = "skinny"
Props(8) = "stupid"
Props(9) = "nerdy"
Props(10) = "wrong"

Repeat
  Event = WaitWindowEvent()
  Select Event
  Case #PB_Event_Gadget
    Select EventGadget()
    Case #Button_0
      th1.s= Thing1(Random(7))
      If FindString(th1," ",0)
        th1.s=StringField(th1,1," ")+" "+Props(Random(7))+" "+StringField(th1,2," ")
      EndIf
      th1+" "
      th2.s=Thing2(Random(10))
      If FindString(th2," ",0)
        th2.s=StringField(th2,1," ")+" "+Props(Random(7))+" "+StringField(th2,2," ")
      EndIf
      th2+" "
      Excuse$ = th1 + DidSomething(Random(9)) + th2
      AddGadgetItem(#Listview_0, 0, Excuse$)
    EndSelect
  Case #PB_Event_CloseWindow
    MessageRequester("oExcuse Generator", "Excuse generator created by oToom ( Ant )")
    Break
  EndSelect
  ForEver
사십 둘 .
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

tu t'extasies devant un truc qui existe deja sur notre forum depuis le 26/11/2005 !!!
Yes perhaps :roll:
In the first time, i don't know your code :shock:
But the french code talk of poetry, and it's a great code too, who give the real and nice sentence 8)
And i thank you, to sharing it too 8)

But the code of oToom give to me a real answer to go to my job monday :lol:
Because, i don't believe that, if i go to last in my job monday, i can give to my boss a poetry :lol:
Or for exchange, i have a good foot kick in my ass :?
ImageThe happiness is a road...
Not a destination
oToom
User
User
Posts: 54
Joined: Sat May 03, 2008 5:38 pm

Post by oToom »

Glad you guys like the idea of this.

Might carry this on?
With a database, which can be added to.
Maybe read off the internet or something?


Well. I will add some more phrases etc.


Once again, glad you liked it!
f1roe
New User
New User
Posts: 4
Joined: Wed Mar 04, 2009 10:29 pm
Location: FRANCE - LYON 3

Post by f1roe »

Kwaï chang caïne wrote:
tu t'extasies devant un truc qui existe deja sur notre forum depuis le 26/11/2005 !!!
Yes perhaps :roll:
In the first time, i don't know your code :shock:
But the french code talk of poetry, and it's a great code too, who give the real and nice sentence 8)
And i thank you, to sharing it too 8)

But the code of oToom give to me a real answer to go to my job monday :lol:
Because, i don't believe that, if i go to last in my job monday, i can give to my boss a poetry :lol:
Or for exchange, i have a good foot kick in my ass :?
Kain suprise ! you live next me !
Seb Lyon 3...
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

Oh yeeees !!!! :shock:
You live in LYON too :D
Me it's a little bit more down in the 7e

We are 3 PB programmers who live in LYON.
You are french or a foreigner student ??? :roll:
Because LYON is a student town

Welcome to PB 8)
ImageThe happiness is a road...
Not a destination
Post Reply