# How to score “command-line” flags in Japt

When I first created Japt I was young and innocent, and I didn't know how to use a command line. So I created the interpreter with HTML and incorporated the JavaScript right into that.

As Japt grew up, I added more features, one of which is a set of flags that slightly change the behavior of the program. Because Japt could only be run in the online interpreter, and Japt parses the input as literals (i.e. strings must be wrapped in quotes, arrays in brackets), I just decided to stick flags in the input box.

This is where the confusion lies. Japt currently can't be run directly from the command line (I'm working on that), so there's no way to include flags as actual arguments; they have to be part of the input. So the question is, how should we score flags in Japt? (Or perhaps they should not be allowed at all in their current state?)

Side note: flags can appear anywhere in the input, up against any of the input types, except it can't be touching a number on the right side. So you can stick any individual flag after the end of the input, adding two bytes. For example:

"abc" 123-P


This is parsed as the string "abc", the number 123, and the -P flag.

Other than this, I believe flags in Japt work the same as in any other language. You can do e.g. -Pg!, which will parse as the -P, -g, and -! flags, and you can do e.g. -g3, which will parse as the -g flag with an argument of 3.

Also, I couldn't manage to find our current consensus on how flags are scored in other languages, though I believe it's just the number of bytes added to the command to invoke the flags.

• IMO, you should just add bytes according to the length of each flag, for -g3, add 3 to your byte count. – Mr. Xcoder Jun 22 '17 at 18:13