Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Examples/python.headache
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file will print *Python* when run
# Also this file contains inline comments as it is created when inline comment
# support is added to Headache

\\ # add newline at the start
+++++++++++++++> # this prints P
@++++++++++++++++++++++++> # this prints y
.-----> # this prints t
@+++++++> # this prints h
.+++++++> # this prints o
.-> # this prints n
\\ # add newline at the end


4 changes: 3 additions & 1 deletion headache.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
prev_counter = 65
for line in file:
counter = 65
if '#' == line[0]:
if line.startswith('#'):
continue
for character in line:
if '\n' == character:
Expand All @@ -36,6 +36,8 @@
counter = 48
elif '.' == character:
counter = prev_counter
elif '#' == character:
break

prev_counter = counter

Expand Down