Giter VIP home page Giter VIP logo

charcoal's Introduction

Charcoal

Want to be able to write basic Charcoal quickly? Then read on. If you came here looking for help, scroll to the bottom for the FAQ.

Example REPL session

To use the REPL, simply invoke with ./charcoal.py, python charcoal.py or python3 charcoal.py.

Charcoal> Hello, World!  
Hello, World!
Charcoal> ^C
Cleared canvas

Literals

There are two basic types of literals: strings and numbers. A string is just a run of printable ASCII, and a number is just a run of the superscript digits ⁰¹²³⁴⁵⁶⁷⁸⁹.

Examples: foo is equivalent to "foo".
foo¶bar is the same as "foo\nbar".
¹²³⁴ is 1234.

Printing

In a Charcoal program, expressions are implicitly printed. Numbers print a line, and arrows can be used to specify a direction.

Examples: foo prints foo
foo⁴ prints foo----
foo↖⁴ prints:

\   
 \  
  \ 
foo\

FAQ

  • When I run Charcoal it throws some errors about UTF-8 characters and exits.
    • Maybe you don't have Python 3 installed. Try installing Python 3 from here.
  • When I run Charcoal it throws some errors and exits.
    • If the message comes with a stack trace, it looks like you have found a bug. File a bug report here, and we'll come back to you as soon as we can.

charcoal's People

Contributors

dloscutoff avatar sconaway avatar somebody1234 avatar urkerab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

charcoal's Issues

Stuff I need

I dislike having Grave mode and Verbose mode. Verbose takes the entire fun out of the language, and Grave mode could have been replaced with the backticks followed by character combinations making more characters. For now I use Grave mode, but I NEED each thing being 1 character. Please fix this.

Miscellaneous bugfixes

  • UB leaves old background characters in areas of canvas left of printed content
  • Refactor Charcoal.__str__
  • CleanExecute should take varargs
  • Some prints have an extra move at the end
  • ←abc↓def has problems
  • Fill, when called on non-enclosed areas, should show an error message instead of dying on IndexError
  • When printing leftward, should move the cursor up, not down

Design decisions

  • What should happen when RotateCopy is passed an odd number of rotations (currently errors)
  • How should separate inputs be separated? Do we assume all input strings are single-line?
  • Do we allow multiline string input?

Internal bug when handling quotes «»

Just tried to experiment with this unusual language. When the interpreter encounters opening quote « character, it crashes with a stack trace:

$ ./charcoal
Charcoal> «
Traceback (most recent call last):
  File "./charcoal", line 4670, in <module>
    normal_encoding=argv.normalencoding
  File "./charcoal", line 4082, in Run
    )(charcoal)
  File "/tmp/Charcoal/interpreterprocessor.py", line 358, in <lambda>
    lambda r: lambda c: ((r[0](c) or True) and r[2](c)),
  File "/tmp/Charcoal/interpreterprocessor.py", line 370, in <lambda>
    lambda r: lambda c: c.Print(r[0](c)),
  File "./charcoal", line 987, in Print
    lines = re.split("[\n\r]", string)
  File "/usr/lib/python3.6/re.py", line 212, in split
    return _compile(pattern, flags).split(string, maxsplit)
TypeError: expected string or bytes-like object

When encounters closing quote », it just does nothing.

Set up CI

Both Travis and AppVeyor, use unit tests for CI

Unary operator aliases on wiki are incorrect

The wiki currently says ++ is an alias for Incremented , Decremented, Doubled and Halved. (copy-paste error, I'm presuming :P)

Operator Verbose Returns
... ... ...
Incremented/++ x+1 if it is a number, ... if it is a string. Vectorizes.
Decremented/++ x-1 if it is a number, ... if it is a string. Vectorizes.
Doubled/++ x*2 if it is a number, ... if it is a string. Vectorizes.
Halved/++ x/2 if it is a number, ... if it is a string. Vectorizes.

According to line 131 to 132 of verbosegrammars.py, these should be ++, --, *** and \\ respectively.

Why isn't the wiki public? And why does Github have no sane way of reporting errors in the wiki?

Create unit test framework

This issue can be closed when a unit test system is up and running, even though it doesn't have full code coverage yet. Adding new tests can be the subject of new issues.

Variables don't work as expected.

For example, the program θ doesn't print the first line of the input, and Iθ does not return the first input if it is a number.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.