Code Monkey home page Code Monkey logo

atto's People

Contributors

carloshm avatar james-livesey avatar pavlos256 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

Watchers

 avatar  avatar  avatar  avatar

atto's Issues

[Announcement] atto is moving to a new home soon!

DeviceFuture logo

Over the coming days, we plan to move atto to a new home, where we will continue to develop atto and build new projects that are part of the atto ecosystem. We're calling our new home DeviceFuture, since we believe that atto plays a part in the future of creating open, accessible software and hardware that anyone can get their hands on and start using to learn about the world of digital technology!

atto will still be maintained by the same people, and we've got some awesome features planned for the future of atto. In order to do this, we're creating the DeviceFuture organisation to develop a unified brand consisting of atto and its related projects.

We will soon be moving atto over to the @devicefuture GitHub organisation where we will then resume fixing bugs, adding features and making atto cooler with every release. This will mean that atto will experience downtime for a short period while we perform this migration. We expect the downtime to last up to a few hours, but if all goes well, you shouldn't notice a thing.

We will move atto to a new domain (atto.devicefuture.org) and to a new GitHub path (devicefuture/atto). GitHub will automatically redirect the old path (James-Livesey/atto) to the new one for those who have made bookmarks of the repo. We will also redirect the jamesl.me/atto path to our new domain, along with all of atto's subpages and custom links. That way, you (hopefully) won't have to manually update all your bookmarks and links to atto!

We're looking forward to the (device)future of atto, and can't wait to work on new projects that we're sure you'll love! Feel free to leave any questions about this migration on this issue, and I'll do my best to answer them ASAP. 😀

-James

Input lag on Firefox

When typing in code in Firefox, the renderer does not always reflect the contents of hidInput. Though all entered text will be intact, the renderer might not show the most up-to-date text that was entered (eg. the last letter may appear to be missing). This bug is also present in Chrome, but only rarely does it happen.

Add how to delete lines for beginner's guide

Currently, the Scratch/Python contains instructions as to how to delete lines of code (by just typing the line number and nothing else). This should ideally be added to the beginner's guide, too. See HN27726371 for a good explanation of how we should make it easier for beginners to use.

good first issue because it's documentation editing, and we welcome good changes made to docs — just make a PR and I'll review it!

Docs UX improvements

Two improvements to make:

  • Scroll the docs to the top whenever a link is clicked
  • Wrap code blocks in the printed versions of the docs (in docs popout) so that horizontal scrollbar is not printed

Add command reference for shell commands

Currently, atto's command reference only lists the commands that can be used as part of a program (such as print and goto). We should also add a new category to the command reference for shell commands that are used to edit programs, such as list, edit, share, import and export.

Add more functions, and document them

Some functions that need adding:

min(a, b)
max(a, b)
repeat$(str$, a)
find(x, a) # x is string or list, -1 means not found

These are functions that already exist in other programming languages, and they could be very useful in atto.

Add home and close buttons for help, and popout option

It may be hard for people to find the navigation breadcrumbs in the help guides, especially on long pages. Going back to the guide root may be tricky since you have to scroll to the top, and you also have to know to scroll to the top. Adding buttons to go home and close the help panel would be useful to newcomers.

A popout option would also be really beneficial to make it easier to multitask. There could also be a print option to get a paper copy of the guide/certain pages of the guide!

See HN27726371 for a detailed explanation of what to improve in this area.

Allow for boolean variable conditions without equality check in `if`

We should be able to write just if booleanCondition instead of having to write if booleanCondition=1, much like with other programming languages. This may require a much-needed overhaul to some of the boolean logic operator behaviour and operator evaluation in general.

We also should have true and false constants, which could be evaluated to 1 and 0 respectively. Then, if conditions can check if an expression's value is nonzero as a means of checking if the value is true.

Make last argument to `mid$` optional

Like other implementations of BASIC, the length argument to mid$ should be optional to get the rest of a string from the starting index, just like substring in JavaScript.

Example (this should print ello:

10 print mid$("Hello", 1)

Currently, we get an Expected another argument to function error as mid$ expects three arguments.

Documentation will need changing to reflect the argument's optionality as well.

mid$ doesn't work with 0,0 arguments

mid$ seems to work incorrectly.

mid$("asd",1,1) is "s",
mid$("asd",0,1) is "a",
mid$("asd",1,2) is "sd" and
mid$("asd",0,0) is "",
which seems incompatible.

Extload doesn't work

Such words like "broadcasting.send" SOMETIMES highlight. Atto saw it, like hours ago, but now it doesn't. Extload also just doesn't work, it's not supported or something? Why? I can provide more information if needed.

GOTO should fall-through when given an invalid line

Consider this program:

 10 PRINT "OK"
 20 GOTO 1

This reports an error ("cannot goto a nonexistant line"), but I think it should fall-through. Reporting an invalid line is probably the correct choice with:

 10 PRINT "BLAH"
 20 GOTO 3000
 2000 PRINT "BLAH"

I guess here the expectation is that GOTO should go to the named line, and if it isn't present the next one that is there. But be limited by the upper-bound of lines that was used.

"random" in "draw" works incorrectly

It looks like the old location is also randomized, but it shouldn't be. If you type:
10 for count=1 to 100
20 draw random*500,random*500
30 next
The lines will NOT be connected to each other. But if after that you type:
11 x=random*500
12 y=random*500
20 draw x,y
renum
It will work correctly.
atto devtools 3
atto devtools 4

gosub does not work as expected not ending nicely the program

the sample code:
10 diameter=5
20 gosub 100
30 print area
40 diameter=12
50 gosub 100
60 print area
70 end
100 print "The area of a circle of diameter "; diameter; " is: ";
110 area = pi*(diameter/2)^2
120 return
run
The area of a circle of diameter 5 is
19.6349540849
The area of a circle of diameter 12 is
113.0973355292
Mismatched statement closing mark at line 70

Adds an error when no error should be the expected

In this other example (forget about the logic )
Nothing to return to at line 160
Ready
shows up

10 cls
20 number_marks = 0
30 while number_marks < 100
40 if number_marks mod 2 = 1
50 ratius=10
60 gosub 140
70 else
80 ratius=5
90 gosub 140
100 break
110 number_marks = number_marks + 1
120 loop
130 end
140 move 250, 200
150 draw ratius, ratius + number_marks
160 return

Handle negatives

When running print -1, atto freezes. This is because the first value has no token. This should instead be checked, and if the first value is tokenless, then it should be 0.

Can't use `renum`

Even after a hard reset, when I try to use renum, it just highlights to the left side and prints a new line. I have no idea why. It doesn't happen with "help", "share" etc. After pressing shift, alt or etc. the cursor stops highlighting. Happened randomly. Possibly related to #43.
atto devtools 7
(Also, some commands' descriptions in the "help" menu are mixed up, but I posted so many issues that I don't wanna post another one)

Add more courses

There's only two courses in the help guide so far. It would be great to have more courses on some of the other aspects of atto, too!

One example of a course to write is how to make subroutines using gosub/return.

Unicode support

Atto has problems with some Unicode characters (like emoji).

Example program:

10 PRINT "Καλημέρα 😄"

test.atto.txt

2021-09-24_16-37

The problem is that when accessing chars like text[9], the emoji is returned in two parts (positions 9 & 10). A workaround is to do:

var chars = Array.from(text);

Then chars[9] will return "😄".

Applying this change to term.js:print() and canvas.js:drawText() seems to be enough to make the above program run correctly. The program listing still has problems though, because of the hid.js:render function.

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.