Simple python lib to work with http://logic-arrows.io
arrows.py's Introduction
arrows.py's People
Forkers
hdsp303arrows.py's Issues
Support for negative position
import arrows
game = arrows.Map()
game.set(-1, -1, arrows.Arrow(arrows.ArrowType.Arrow))
game.export()
# Traceback (most recent call last):
# File "<stdin>", line 1, in <module>
# File "/home/user/things/things/code/python/arrows/arrows.py", line 140, in export
# push16(cords[0])
# File "/home/user/things/things/code/python/arrows/arrows.py", line 129, in push16
# raw_data.extend(val.to_bytes(byteorder='little', length=2))
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# OverflowError: can't convert negative int to unsigned
Original game handles them like this:
if (chunk.x < 0) chunkBytesX[1] |= 0x80;
else chunkBytesX[1] &= 0x7F;
if (chunk.y < 0) chunkBytesY[1] |= 0x80;
else chunkBytesY[1] &= 0x7F;
Add examples & documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.