User:Laura Macchini/prototyping/marryme: Difference between revisions

From XPUB & Lens-Based wiki
Line 24: Line 24:
<source lang="text">
<source lang="text">
  Soldier, soldier, will you marry me  
  Soldier, soldier, will you marry me  
With your musket, fife and drum?
Oh how can I marry such a pretty little girl
When I have no coat to put on?
Off to the tailor she did go
As fast as she could run
She brought him back the finest that was there
Now soldier, put them on
Soldier, soldier, will you marry me
With your musket, fife and drum?
Oh how can I marry such a pretty little girl
When I have no shoes to put on?
Off to the tailor she did go
As fast as she could run
She brought him back the finest that was there
Now soldier, put them on
Soldier, soldier, will you marry me
With your musket, fife and drum?
Oh how can I marry such a pretty little girl
When I have no hat to put on?
Off to the tailor she did go
As fast as she could run
She brought him back the finest that was there
Now sol Soldier, soldier, will you marry me
  With your musket, fife and drum?  
  With your musket, fife and drum?  
  Oh how can I marry such a pretty little girl
  Oh how can I marry such a pretty little girl
Line 52: Line 80:
  She brought him back the finest that was there  
  She brought him back the finest that was there  
  Now soldier, put it on
  Now soldier, put it on
Soldier, soldier, will you marry me
With your musket, fife and drum?
Oh how can I marry such a pretty little girl
When I've a wife and child at home?
</source>dier, put it on


  Soldier, soldier, will you marry me  
  Soldier, soldier, will you marry me  

Revision as of 12:22, 20 October 2011

The Code

#!/usr/bin/python

beginning = " Soldier, soldier, will you marry me \n With your musket, fife and drum? \n Oh how can I marry such a pretty little girl"
items = ["coat","shoes","hat"]
ending = "When I've a wife and child at home?"
midlist = ["it","them"]
places = ["tailor","cobbler","hatter"]
for x in range(0,3):
	print beginning
	print "When I have no "+items[x]+" to put on?"
	print
	if x != 2:
		print "Off to the "+places[x]+" she did go \n As fast as she could run \n She brought him back the finest that was there \n Now soldier, put "+midlist[1]+" on"
	else:
		print "Off to the "+places[x]+" she did go \n As fast as she could run \n She brought him back the finest that was there \n Now soldier, put "+midlist[0]+" on"
	print
print beginning
print ending

The Result

 Soldier, soldier, will you marry me 
 With your musket, fife and drum? 
 Oh how can I marry such a pretty little girl
When I have no coat to put on?

Off to the tailor she did go 
 As fast as she could run 
 She brought him back the finest that was there 
 Now soldier, put them on

 Soldier, soldier, will you marry me 
 With your musket, fife and drum? 
 Oh how can I marry such a pretty little girl
When I have no shoes to put on?

Off to the tailor she did go 
 As fast as she could run 
 She brought him back the finest that was there 
 Now soldier, put them on

 Soldier, soldier, will you marry me 
 With your musket, fife and drum? 
 Oh how can I marry such a pretty little girl
When I have no hat to put on?

Off to the tailor she did go 
 As fast as she could run 
 She brought him back the finest that was there 
 Now sol Soldier, soldier, will you marry me 
 With your musket, fife and drum? 
 Oh how can I marry such a pretty little girl
When I have no coat to put on?

Off to the tailor she did go 
 As fast as she could run 
 She brought him back the finest that was there 
 Now soldier, put them on

 Soldier, soldier, will you marry me 
 With your musket, fife and drum? 
 Oh how can I marry such a pretty little girl
When I have no shoes to put on?

Off to the tailor she did go 
 As fast as she could run 
 She brought him back the finest that was there 
 Now soldier, put them on

 Soldier, soldier, will you marry me 
 With your musket, fife and drum? 
 Oh how can I marry such a pretty little girl
When I have no hat to put on?

Off to the tailor she did go 
 As fast as she could run 
 She brought him back the finest that was there 
 Now soldier, put it on

 Soldier, soldier, will you marry me 
 With your musket, fife and drum? 
 Oh how can I marry such a pretty little girl
When I've a wife and child at home?

dier, put it on

Soldier, soldier, will you marry me 
With your musket, fife and drum? 
Oh how can I marry such a pretty little girl

When I've a wife and child at home? </source>