skx / gobasic

A BASIC interpreter written in golang.
https://blog.steve.fi/tags/basic/
GNU General Public License v2.0
323 stars 27 forks source link

Implement XOR. #45

Closed skx closed 5 years ago

skx commented 5 years ago

We could add this easily.

skx commented 5 years ago

See #46 for a similar issue, and #49 which implemented it.

I'll leave this open for a week, if nobody claims it by then I'll implement it myself.

Biggest difference in the previous pull-request is that we have to handle the token "XOR", and the new operation will be dropped into eval.go in the function expr.

Test case:

10 LET a = 128 XOR 1
20 PRINT a, "\n"

Should print 129.