Jump to content




Pi calculator: 108 attempt to compare __lt on table and number


  • You cannot reply to this topic
9 replies to this topic

#1 TurtleHunter

  • Members
  • 112 posts

Posted 15 March 2014 - 09:28 PM

Im trying to port this: http://powdertoy.co....ml?Thread=16546 to cclua and to use bigInt.

I have a (working) program but it doesnt give any output no matter how many times you run it.

Can somebody tell me where is the error?

pastebin: http://pastebin.com/CDPWY8KS


Edit: Im using a new bigInt from https://bitbucket.or...b687/bigint.lua

http://pastebin.com/CDPWY8KS

Now the error is on the line 108: attempt to compare __lt on table and number

Edited by TurtleHunter, 16 March 2014 - 12:57 AM.


#2 CometWolf

  • Members
  • 1,283 posts

Posted 15 March 2014 - 11:15 PM

Quote

doesnt give any output
Any output at all, or just no number output?

Also that yield function is not nessacary, just use sleep(0).

#3 TurtleHunter

  • Members
  • 112 posts

Posted 15 March 2014 - 11:59 PM

any output at all just a blank line, and i want to be eficient with the yields but also when i do it i want to wait a sec after so you can see the current value

#4 CometWolf

  • Members
  • 1,283 posts

Posted 16 March 2014 - 12:21 AM

That yield function has got to go then, since it will only wait if your program has been running for over 2 seconds. Replace it with a sleep(1), and the program will wait 1 second between each run.

Edited by CometWolf, 16 March 2014 - 12:27 AM.


#5 TurtleHunter

  • Members
  • 112 posts

Posted 16 March 2014 - 12:31 AM

I found the problem, i forgot that i use negatives number in one point so i cant use bigInt.Nobody knows a computercraft implementation of bigInt that supports negatives of a pure lua one that i can port?


Edit: Nevermind found one, i will port it and use it

Edited by TurtleHunter, 16 March 2014 - 12:44 AM.


#6 TurtleHunter

  • Members
  • 112 posts

Posted 16 March 2014 - 12:54 AM

Im using a new bigInt from https://bitbucket.or...b687/bigint.lua

http://pastebin.com/CDPWY8KS

Now the error is on the line 108: attempt to compare __lt on table and number

#7 CometWolf

  • Members
  • 1,283 posts

Posted 16 March 2014 - 12:59 AM

Ugh, im getting pretty tired of these. When using someone else's code, use your head and do the logical thing, ask the person who made it.

#8 TurtleHunter

  • Members
  • 112 posts

Posted 16 March 2014 - 01:03 AM

View PostCometWolf, on 16 March 2014 - 12:59 AM, said:

Ugh, im getting pretty tired of these. When using someone else's code, use your head and do the logical thing, ask the person who made it.

Alone his code works, mine doesnt thats why i post here also that program is from the year 2000...

#9 CometWolf

  • Members
  • 1,283 posts

Posted 16 March 2014 - 01:15 AM

View PostTurtleHunter, on 16 March 2014 - 01:03 AM, said:

Alone his code works, mine doesnt thats why i post here also that program is from the year 2000...
-- Copyright (c) 2010 Ted Unangst <[email protected]>
Year 2000.... right >.>.
That dosen't change the fact that he knows his own code better than we probably ever will, or will ever aspire to. We are here to help you with your code, not someone's code whom we can't ask functional questions of.

#10 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 16 March 2014 - 02:21 AM

Let's tone it back a little bit. Help, fantastic. Don't want to help, don't help. No need to get quite that hostile toward people for asking questions.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users