Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there - I am the author of the java cowsay port and have contributed to your JS port previously.
I have been testing java cowsay against native cowsay to make sure it is "accurate", not only on the standard cowfiles but also on other cowfiles I come across. This includes the roughly 190 cowfiles in your project.
My goal was to ensure the output of java cowsay matched native cowsay - you may not share the same goal, but for now I'm going to assume that you do.
I found issues in your cowfiles and initially I was fixing them as I went. In the end I changed the way my cowsay worked (it used to have an almost identical algorithm to yours) so that java cowsay would handle these in the same way as native cowsay. At this point I stopped fixing your cowfiles. This PR is what I got up to and would address most of the problems.
Specifically there are two classes of error that this applies to:
Superfluous Escapes
\'
or hash character\#
your cowsay (and my old version) will faithfully render\#
whereas native cowsay will render#
.An example of this is C3PO which your cowsay will render with wonky hands and undercarriage:
But native cowsay renders it like so (note the hands are nicely aligned):
This problem can be addressed by fixing the cowfiles (I fixed many) or changing your code (that's what I ended up doing to java cowsay). This is not something that can be reliably solved with regular expressions. A finite state machine would be a good option and probably only take a few hours coding.
Other examples are moojira, lightbulb, cake-with-candles, biohazard and glados.
Missing Escapes
\
which will be consumed by native cowsay but rendered by JS cowsay, for example docker-whale renders with missing detail in native cowsay:JS cowsay does not care about the missing escapes:
I decided to make java cowsay behave like native cowsay even though the output is missing detail I want it to behave as much like native cowsay as possible.
I fixed a whole lot of these but probably not all. Other examples are the yasuna cows, atat, r2d2, whale, and chito.
The other common characters missing escapes are
$
, for example golden-eagle and@
for example explosionIncomplete cowfiles
Another problem is that many of your cowfiles have drifted away from being usable by native cowsay. This is most commonly due to missing a variable, usually the
$eye
variable, for example your kitty has no eyes in native cowsay:You don't need to care, it depends how much you desire interoperability.
On that topic, your cowsay has cool yet divergent feature where $eye is replaced with a left and a right eye which may be different characters - this is not consistent with native cowsay (where $eye is a variable that will be replaced with the same value in both places).
Yasuna 08
Unparsable by native cowsay:
bkendzior cowfiles
You also have these: bkendzior/cowfiles#13