Git Product home page Git Product logo

Comments (3)

QBFreak avatar QBFreak commented on July 20, 2024

Aren't all subscripts in Lua actually more like keys in key value pairs? If so, there's technically no 'first slot' to be ignored. Try putting something in arr[1] and using the function to print arrays (drawing a blank ATM), I bet you'll find that's the only one it shows you. Skip ahead to arr[5] and do it again. Iirc, you'll just get values for 1 and 5, nothing else. It's less that the others are empty and more that they don't exist. Unless I'm remembering wrong, then forget everything I just said :)

Regardless, I started at 1 for a reason although I can't recall what at the moment. Take a look where the values of message get used, perhaps there I found it easier to start at 1 than 0.

from qdtts.

Cing2 avatar Cing2 commented on July 20, 2024

I haven't looked in your code to much but if you also use 1 for the first
message then there is no problem.
But when i used your code i started at 0 so i didn't got well.

2016-04-17 3:11 GMT+02:00 Jason Hill [email protected]:

Aren't all subscripts in Lua actually more like keys in key value pairs?
If so, there's technically no 'first slot' to be ignored. Try putting
something in arr[1] and using the function to print arrays (drawing a blank
ATM), I bet you'll find that's the only one it shows you. Skip ahead to
arr[5] and do it again. Iirc, you'll just get values for 1 and 5, nothing
else. It's less that the others are empty and more that they don't exist.
Unless I'm remembering wrong, then forget everything I just said :)

Regardless, I started at 1 for a reason although I can't recall what at
the moment. Take a look where the values of message get used, perhaps there
I found it easier to start at 1 than 0.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#2 (comment)

from qdtts.

QBFreak avatar QBFreak commented on July 20, 2024

Now that I'm back at a PC and not squinting at my phone, I took a quick peek at server.lua line 126 where message gets used and I definitely start at 1. message[1] is the command, message[2] is the sending turtle name. Any additional parameters vary depending on the command. I don't recall why I started at 1, I may have originally been planning on putting a count in 0.

from qdtts.

Related Issues (1)

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.