Skip to content

Feature: add createASCII method - #54

Merged
kazuhikoarase merged 2 commits into
kazuhikoarase:masterfrom
ahwayakchih:feature/createASCII
Sep 1, 2018
Merged

Feature: add createASCII method#54
kazuhikoarase merged 2 commits into
kazuhikoarase:masterfrom
ahwayakchih:feature/createASCII

Conversation

@ahwayakchih

@ahwayakchih ahwayakchih commented Jun 19, 2018

Copy link
Copy Markdown
Contributor

Hi,

This re-applies ASCII output feature from #6. It does not change existing code, it just adds new method.

I use ASCII output in command line tools/scripts :).

Changes:

  • Added createASCII method that outputs QR code rendered using ASCII blocks.
  • Added JS development dependency on mocha to run new tests for basic GIF and ASCII output.

UPDATE: below is a screenshot of how it looks in terminal :).

qrcode-generator-createascii

Regards

- Added `createASCII` method that outputs QR code rendered using ASCII blocks.
- Added JS development dependency on `mocha` to run new tests for basic GIF and ASCII output.
@nayuki

nayuki commented Aug 31, 2018

Copy link
Copy Markdown

Two problems:

  • You named the method createASCII(), but the block characters are in Unicode.
  • How do you account for the fact that some text terminals are white-on-black, and some are black-on-white?

@ahwayakchih

Copy link
Copy Markdown
Contributor Author

@nayuki thanks for comment. You're right that it's actually Unicode. We can rename the method, e.g., "createUnicode" or call it something else. I was going for reminding about "ASCII drawing", but it looks that i was wrong. Any ideas how to name it better?

It returns a string, it's up to the caller to style it with control sequences in terminal, or CSS in web browser.

@kazuhikoarase
kazuhikoarase merged commit 40a8a25 into kazuhikoarase:master Sep 1, 2018
@kazuhikoarase

Copy link
Copy Markdown
Owner

I was going for reminding about "ASCII drawing",

I agree.

Thanks a lot!

@ahwayakchih

Copy link
Copy Markdown
Contributor Author

Thanks :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants