Skip to content

Commit

Permalink
add $X$ for $\$ crossing $/$
Browse files Browse the repository at this point in the history
Signed-off-by: Mattias Andrée <maandree@operamail.com>
  • Loading branch information
maandree authored and JotaRandom committed May 23, 2013
1 parent ce1d99f commit 5bb6879
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions balloons/ascii.say
@@ -1,5 +1,6 @@
/:/
\:\
X:X

n:_
:
Expand Down
1 change: 1 addition & 0 deletions balloons/ascii.think
@@ -1,5 +1,6 @@
/:o
\:o
X:o

n:_
:
Expand Down
1 change: 1 addition & 0 deletions balloons/cowsay.say
@@ -1,5 +1,6 @@
/:/
\:\
X:X

n:_
s:-
Expand Down
1 change: 1 addition & 0 deletions balloons/cowsay.think
@@ -1,5 +1,6 @@
/:o
\:o
X:o

n:_
s:-
Expand Down
1 change: 1 addition & 0 deletions balloons/linux-vt.say
@@ -1,5 +1,6 @@
/:/
\:\
X:X

n:─
:
Expand Down
1 change: 1 addition & 0 deletions balloons/round.say
@@ -1,5 +1,6 @@
/:╱
\:╲
X:╳

n:─
:
Expand Down
1 change: 1 addition & 0 deletions balloons/unicode.say
@@ -1,5 +1,6 @@
/:╱
\:╲
X:╳

n:─
:
Expand Down
1 change: 1 addition & 0 deletions balloons/unicode.think
@@ -1,5 +1,6 @@
/:o
\:o
X:o

n:⁀
s:‿
Expand Down
3 changes: 2 additions & 1 deletion src/backend.py
Expand Up @@ -69,7 +69,8 @@ def __init__(self, message, ponyfile, wrapcolumn, width, balloon, hyphen, linkco

if self.balloon is not None:
self.link = {'\\' : linkcolour + self.balloon.link,
'/' : linkcolour + self.balloon.linkmirror}
'/' : linkcolour + self.balloon.linkmirror,
'X' : linkcolour + self.balloon.linkcross}
else:
self.link = {}

Expand Down
13 changes: 7 additions & 6 deletions src/balloon.py
Expand Up @@ -43,6 +43,7 @@ class Balloon():
@param link:str The \-directional balloon line character
@param linkmirror:str The /-directional balloon line character
@param linkcross:str The /-directional balloon crossing a \-driectional ballonon line character
@param ww:str See the info manual
@param ee:str See the info manual
@param nw:list<str> See the info manual
Expand All @@ -62,8 +63,8 @@ class Balloon():
@param w:str See the info manual
@param nww:str See the info manual
'''
def __init__(self, link, linkmirror, ww, ee, nw, nnw, n, nne, ne, nee, e, see, se, sse, s, ssw, sw, sww, w, nww):
(self.link, self.linkmirror) = (link, linkmirror)
def __init__(self, link, linkmirror, linkcross, ww, ee, nw, nnw, n, nne, ne, nee, e, see, se, sse, s, ssw, sw, sww, w, nww):
(self.link, self.linkmirror, self.linkcross) = (link, linkmirror, linkcross)
(self.ww, self.ee) = (ww, ee)
(self.nw, self.ne, self.se, self.sw) = (nw, ne, se, sw)
(self.nnw, self.n, self.nne) = (nnw, n, nne)
Expand Down Expand Up @@ -144,12 +145,12 @@ def fromfile(balloonfile, isthink):
## Use default balloon if none is specified
if balloonfile is None:
if isthink:
return Balloon('o', 'o', '( ', ' )', [' _'], ['_'], ['_'], ['_'], ['_ '], ' )', ' )', ' )', ['- '], ['-'], ['-'], ['-'], [' -'], '( ', '( ', '( ')
return Balloon('\\', '/', '< ', ' >', [' _'], ['_'], ['_'], ['_'], ['_ '], ' \\', ' |', ' /', ['- '], ['-'], ['-'], ['-'], [' -'], '\\ ', '| ', '/ ')
return Balloon('o', 'o', 'o', '( ', ' )', [' _'], ['_'], ['_'], ['_'], ['_ '], ' )', ' )', ' )', ['- '], ['-'], ['-'], ['-'], [' -'], '( ', '( ', '( ')
return Balloon('\\', '/', 'X', '< ', ' >', [' _'], ['_'], ['_'], ['_'], ['_ '], ' \\', ' |', ' /', ['- '], ['-'], ['-'], ['-'], [' -'], '\\ ', '| ', '/ ')

## Initialise map for balloon parts
map = {}
for elem in ('\\', '/', 'ww', 'ee', 'nw', 'nnw', 'n', 'nne', 'ne', 'nee', 'e', 'see', 'se', 'sse', 's', 'ssw', 'sw', 'sww', 'w', 'nww'):
for elem in ('\\', '/', 'X', 'ww', 'ee', 'nw', 'nnw', 'n', 'nne', 'ne', 'nee', 'e', 'see', 'se', 'sse', 's', 'ssw', 'sw', 'sww', 'w', 'nww'):
map[elem] = []

## Read all lines in the balloon file
Expand All @@ -169,7 +170,7 @@ def fromfile(balloonfile, isthink):
map[last].append(value)

## Return the balloon
return Balloon(map['\\'][0], map['/'][0], map['ww'][0], map['ee'][0], map['nw'], map['nnw'], map['n'],
return Balloon(map['\\'][0], map['/'][0], map['X'][0], map['ww'][0], map['ee'][0], map['nw'], map['nnw'], map['n'],
map['nne'], map['ne'], map['nee'][0], map['e'][0], map['see'][0], map['se'], map['sse'],
map['s'], map['ssw'], map['sw'], map['sww'][0], map['w'][0], map['nww'][0])

0 comments on commit 5bb6879

Please sign in to comment.