-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ideas for Golfing #35
Comments
Looking through CJam's docs, I found these interesting operators that would work nicely in O. |
Idea: create a map of the most-oft-used characters, find the ones that are hardly used, and reserve them into two-byte tokens. (e.g. CJam's |
Idea number 2: All input is initialized on the stack, and the top member(s) of the stack is implicitly outputted? |
@ConorOBrien-Foxx You just said what @phase mentioned at the very top... :) |
I like two byte tokens, but if you want to use them they're two bytes instead of one. Seriously doesn't have this issue because (almost) every one byte character does multiple things. I'd seriously choose coding in a hex editor over using two bytes. |
@kirbyfan64 How do you feel about the input/output? Do you want to start work on changing it? I think we should keep the inputting the way it is, but take out |
I think O still needs some sort of I/O system like it has now in addition to dumping the stack at the program's end. That way it can work on infinite output challenge. |
@kirbyfan64 How about we keep everything we have now, but just output the stack at the end? |
@phase That's what I meant. I was just rushing and didn't word it in human English. ;) |
@kirbyfan64 How should it be outputted? In reverse or normal? Like:
|
@phase Hmmm...well CJam prints them like |
@kirbyfan64 I was just testing that :P |
@kirbyfan64 Here's what it does currently, is this the desired way we want to output? |
@phase I guess that looks about right! |
An operator to push a blank string would also be nice, when using it with #43. There may be ways around this, though. |
@kirbyfan64 Do we want to delve into the land of nonasciiia? I set up a text file as a checklist to see what characters we've used, and we're definitely running out. We could just use 0 through 32 codepoints, as they're only |
@phase Well, Pyth uses two-byte sequences (like It would maybe be neat to try both approaches: non-ASCII and two-byte sequence. |
Operator overloading is something we need. We could use We could also use |
In normal programming languages, like C, it takes 3 bytes to increment a variable: In O, it's just sad
We could have something like
|
Are you using the one-byte guillemets? |
This thread is going to be a place where we discuss ideas on making O better suited for codegolf. Right now O can be pretty verbose and is easily beaten by other languages such as Pyth and Seriously (both written in Python). Here are some ideas on how we can solve this issue:
Something needs to be done about implicit input/output.DONE!i
ando
take up too many bytes. Let's compare it with GolfScript (which is so old it loses pretty much everything). Outputting the string 111 in GS is just111
. In O, there are a couple ways to do this. We could output each number by itself,1o1o1o
, which is 3 bytes more. We could output it as a string,"111"o
, which is still 3 bytes more. A good idea would to have everything on the stack outputted when the code is finished executing. The input could be pushed to the beginning of the stack before the code executes./cc @kirbyfan64
The text was updated successfully, but these errors were encountered: