Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1656)

Unified Diff: doxypypy/doxypypy/test/sample_maze.out.py

Issue 1574883002: add doxypypy and py_filter so this will turn google style (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: doxypypy/doxypypy/test/sample_maze.out.py
diff --git a/doxypypy/doxypypy/test/sample_maze.out.py b/doxypypy/doxypypy/test/sample_maze.out.py
new file mode 100644
index 0000000000000000000000000000000000000000..3ed55dda04a387421f6b044b7f6feb6b30afa5a5
--- /dev/null
+++ b/doxypypy/doxypypy/test/sample_maze.out.py
@@ -0,0 +1,44 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+## @brief Generate a simple maze pattern.
+#
+#Tip of the hat to both the original Commodore 64 program and the book
+#"10 Print Chr$(205.5+rnd(1)); Goto 10" that it inspired.
+#
+#Note that this is neither the shortest nor the most faithful way to
+#write this program in Python. Rather it is being used as a simple
+#example for the doxypypy Doxygen input filter for Python and makes use
+#of features like keyword arguments and generators and has a docstring
+#that documents them both appropriately.
+#
+
+
+from sys import stdout
+from random import choice
+
+
+## @brief Generates a single block of a maze.
+#
+# This simple generator randomly picks a character from a list (the two
+# diagonal lines by default) and returns it on each iteration.
+#
+#
+# @param blockOptions The list of characters to choose from.
+#
+# @return
+# A single character chosen from blockOptions.
+#
+# @namespace sample_maze.generateBlock
+
+def generateBlock(blockOptions=u"╱╲"):
+ while True:
+ yield choice(blockOptions)
+
+# Establish our block generator and generate a series of blocks.
+blockGenerator = generateBlock()
+blockCount = 0
+while blockCount < 3200:
+ blockCount += 1
+ print(next(blockGenerator)),
+ # Deal with Python's extra space print weirdness.
+ stdout.softspace = False

Powered by Google App Engine
This is Rietveld 408576698