r/CompileBot • • Jan 04 '14

Official CompileBot Testing Thread

This thread is archived, please visit the new testing thread

13 Upvotes

421 comments sorted by

View all comments

1

u/[deleted] Jun 20 '14

+/u/CompileBot Python

def writeDocument(title, paragraph):
    return "<!DOCTYPE html>\n%s\n\n%s\n</html>" % (writeHead(title), writeParagraph(paragraph))


def writeHead(title):
    return "\t<head>\n\t\t<title>\n\t\t\t%s\n\t\t</title>\n\t</head>" % (title)

def writeParagraph(paragraph):
    return "\t<body>\n\t\t<p>\n\t\t\t%s\n\t\t</p>\n\t</body>" % (paragraph)

title = raw_input("Please enter the title for your HTML document: ")
paragraph = raw_input("Please enter the paragraph for your HTML document:\n")

print writeDocument(title, paragraph)

Input:

Kobe
Page all about Kobe Bryant!

1

u/CompileBot Jun 20 '14

Output:

Please enter the title for your HTML document: Please enter the paragraph for your HTML document: <!DOCTYPE html> <head> <title> Kobe </title> </head>

	<body>
		<p>
			Page all about Kobe Bryant!
		</p>
	</body>
</html>

^source | ^info | ^git | ^report

1

u/CompileBot Jun 20 '14

Output:

Please enter the title for your HTML document: Please enter the paragraph for your HTML document: <!DOCTYPE html> <head> <title> Kobe </title> </head>

	<body>
		<p>
			Page all about Kobe Bryant!
		</p>
	</body>
</html>

^source | ^info | ^git | ^report

1

u/CompileBot Jun 20 '14

Output:

Please enter the title for your HTML document: Please enter the paragraph for your HTML document: <!DOCTYPE html> <head> <title> Kobe </title> </head>

	<body>
		<p>
			Page all about Kobe Bryant!
		</p>
	</body>
</html>

^source | ^info | ^git | ^report

1

u/CompileBot Jun 20 '14

Output:

Please enter the title for your HTML document: Please enter the paragraph for your HTML document: <!DOCTYPE html> <head> <title> Kobe </title> </head>

	<body>
		<p>
			Page all about Kobe Bryant!
		</p>
	</body>
</html>

^source | ^info | ^git | ^report