Browse Source

example print script

pixelbath 3 years ago
parent
commit
a10003b0a8
2 changed files with 6 additions and 2 deletions
  1. 2 2
      README.md
  2. 4 0
      example-printc.py

+ 2 - 2
README.md

@@ -5,7 +5,7 @@ This code uses a lot of drummyfish's `img2map.py` code as-is; I simply wrapped i
 
 The plan is to get this app to a point where you point it at an assets folder and either create a new map or edit an existing map image. From that point, it can export classes or images, whichever is preferred.
 
-To use the C generator by itself, just create a python script with the following:
+To use the C generator by itself, you can use the following code:
 
 ```Python
 from anarchmap import AnarchMap
@@ -14,7 +14,7 @@ map = AnarchMap('./level0.gif')
 map.printC()
 ```
 
-You can then use that file similar to drummyfish's original script: `python3 myscript.py > level0.c`
+The above code is included as `example-printc.py`, and can be used like so: `python3 example-printc.py > level0.c`.
 
 ## License
 I release everything in this repository under CC0 1.0 (public domain, https://creativecommons.org/publicdomain/zero/1.0/) + a waiver of all other IP rights (including patents), which is as follows:

+ 4 - 0
example-printc.py

@@ -0,0 +1,4 @@
+from anarchmap import AnarchMap
+
+map = AnarchMap('./level0.gif')
+map.printC()