GithubHelp home page GithubHelp logo

thunno / thunno2 Goto Github PK

View Code? Open in Web Editor NEW
21.0 1.0 2.0 4.37 MB

A concise golfing language

Home Page: https://not-thonnu.github.io/run

License: Creative Commons Zero v1.0 Universal

Python 100.00%
code-golf golfing golfing-language programming-language python stack stack-based thunno2

thunno2's Introduction

Thunno 2

A concise golfing language

Test status Downloads Last Commit

Links

Thunno 2 has its own online interpreter, where you can try Thunno 2 online. Thunno 2 is also on Attempt This Online!, an online sandbox environment for running code in hundreds of different programming languages.

If you have any questions about Thunno 2, feel free to ping me (@TheThonnu) in the Thunno 2 chatroom.

Installation

You'll need Python 3.6+ to run Thunno 2. If you don't have this already, you can download it from here.

You can install Thunno 2 via PyPI.

Run the following command in your terminal:

pip install thunno2

It will install the latest version of Thunno 2.

Running

Then, to run your code, just type thunno2 into the terminal.

This will start the interpreter. After that, type in your code, input and flags when prompted.

Documentation

See the docs folder for the documentation.

Tips

For tips on how to code-golf in Thunno 2, see Tips for golfing in Thunno 2 on Code Golf Stack Exchange.

License

© Thunno organisation 2023

The code in this repository is licenced under the Creative Commons Zero v1.0 Universal License. See LICENSE.txt for the full license.

thunno2's People

Contributors

jacob-lockwood avatar nayakrujul avatar not-thonnu avatar pre-commit-ci[bot] avatar

Stargazers

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

Watchers

 avatar

thunno2's Issues

Make `assign` vectorize better

Short decription of what the command is

Assign ȧ already exists, but it only really works for setting an item at a single index. It would be more useful if it worked on a list of indices and a list of items to set at those indices.

Examples

[1;2;3;4;5;6;7;8] [2;4;6] [9;10;11] assign -> [1;2;9;4;10;6;11;8]
# should still work if both arguments aren't lists:
[1;2;3;4;5;6;7;8] [2;4;6] 9 assign -> [1;2;9;4;9;6;9;8]
[1;2;3;4;5;6;7;8] 2 [9;10;11] assign -> [1;2;[9;10;11];4;5;6;7;8]

Some token names are inconsistent

I'm going to list a couple of the token names that don't really fit in with the others here. This is not a complete list.

  • Ȧ isalphanum should be one of is_alphanum is_alpha_num is_alphanumeric
  • dyadic_lcm should allow dyadic_least_common_multiple
  • ɠ two_fifty_six should allow two_hundred_fifty_six (but at that point, what's the point of having a token for this?)
  • Ɲ newline_join should allow join_by_newlines
  • fifth should allow fifth_power
  • fourth should allow fourth_power
  • I binary_range should be inclusive_range (I think?)
  • H from_hex should allow from_hexadecimal
  • A isalpha should either be or allow is_alpha

Codepoint builtins

(I'm Jacob on SE)

This seems like a very cool language and good successor to the original Thunno. I realize it still seems to be in early development but I just wanted to point out that it is missing built-ins for dealing with codepoints.

The original Thunno was also missing these functions, which was pretty annoying at times and basically makes it not able to compete with other languages for many challenges.

Commands that would be very useful:

  • number → string
  • string → number[]
  • number[] → string
  • codepoint at index of string

I don't know much python but I might be able to submit a PR if it would help @nayakrujul

nmap, 2map, 3map to map multiple lists to a single list

Short decription of what the command is

I'm stealing this idea from Factor because it's pretty useful, and I think it would come in handy for golf.

nmap pops an integer n and n lists a1, ...aN, and for each index i in the shortest list, passes a1[i], a2[i], ...aN[i] through a single callback. The results of the callback are collected to a single array.

For example: [1;2;3] [4;5;6] [7;8;9] 3 nmap + + ; yields [12;15;18].

Also handy: 2map, 3map, which are the same as nmap but with n hardcoded.

Examples

[1;2;3] [4;5;6] [7;8;9] 3 nmap + + ; -> [12;15;18]
[1;2;3] [4;5;6] [7;8;9] 3map + + ; -> [12;15;18]
[1;2;3] [4;5;6] [7;8;9] 3map - + ; -> [4;5;6]
"Hello" "World!" 2map + ; -> ["WH";"oe";"rl";"ll";"do"]

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.