devicefuture / atto Goto Github PK
View Code? Open in Web Editor NEWThe new BASIC computer that runs in your browser!
Home Page: https://atto.devicefuture.org
License: MIT License
The new BASIC computer that runs in your browser!
Home Page: https://atto.devicefuture.org
License: MIT License
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.
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.
(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)
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.
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!
When a line is scrolled and a token with a background colour is one or two characters before the scroll start, then the background doesn't render, whereas it should.
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.
I expected sqrt(0) to return 0
10 print sqrt(0)
run
Maths error
Atto has problems with some Unicode characters (like emoji).
Example program:
10 PRINT "Καλημέρα 😄"
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.
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.
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
.
Also should make sure that program is interrupted and HID inputs are finished if they are pressed.
Not a big bug, but if you press ArrowUp or ArrowDown when editing (or probably inputting), cursor's position will stay the same until you press something but ArrowUp/ArrowDown.
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.
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
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.
Two improvements to make:
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.
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.
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
.
when part of a variable includes a reserved word it breaks:
10 cls
20 radius=10
30 print radius
run
Unexpected =
at line 20
Ready
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.
For some reason I can't do arithmetic operations with array elements.
(Type conversion error
)
Example: dim array:push 1,array:print array:print array[0]+1
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.