This is not sparta..? I am lost ;_;

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Raider
Prole
Posts: 11
Joined: Fri Jul 31, 2009 12:49 pm

Re: This is not sparta..? I am lost ;_;

Post by Raider »

--I'm with Raider on this on this one. I use both Py-- BrainFuck and Lua, and love them both.

You use the BF interpreter implemented in Python?

--Although the "none-existant = nil" thing was something I liked at first, later on it just annoys me, because Lua won't complain if I misspell anything other than an indexed table or called function.

Woa, good point. I'd better remember that.

--BTW, about the obey thing: Have you read this thread? Any questions about motivation are better directed at rude ;).

Aye, I'd seen that. Merely wondering what it was about, =P

Compliance will ensue should I get an avatar!
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: This is not sparta..? I am lost ;_;

Post by Robin »

Raider wrote:You use the BF interpreter implemented in Python?
Haha, no. It was an inside joke (perhaps this was not the best place for it :monocle:). You see, because mentioning Python here makes people jokingly cry "heretic!", I started using BrainFuck as a euphemism for Python.
Help us help you: attach a .love.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: This is not sparta..? I am lost ;_;

Post by bartbes »

people? only one personality here

on-topic:
one of the most annoying things is that you cant copy a table
and though debbugging nils is not easy but it provides some new ways to handle stuff
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: This is not sparta..? I am lost ;_;

Post by Robin »

bartbes wrote:people? only one personality here
I was using people as a euphemism for you. I don't know if you know this, but people are afraid of mentioning you. (And by people, I mean me. :emo:)
bartbes wrote:one of the most annoying things is that you cant copy a table
and though debbugging nils is not easy but it provides some new ways to handle stuff
True, true and true. It's also a shame that you can't just print() tables.
Help us help you: attach a .love.
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: This is not sparta..? I am lost ;_;

Post by bmelts »

Robin wrote:It's also a shame that you can't just print() tables.

Code: Select all

function printtable(t)
  for k,v in pairs(t) do
     print(tostring(k)..": "..tostring(v))
  end
end
There's your basic printtable function.

We can also get more complicated and implement recursion through tables inside tables...

Code: Select all

function printtable(t, i)
  if not i then i = 0 end
  local indent = string.rep("\t", i)
  for k,v in pairs(t) do
    if type(v) == "table" then
      print(indent..tostring(k).." (table): ")
      printtable(v, i+1)
    else
      print(indent..tostring(k)..": "..tostring(v))
    end
  end
end
Then it's just a question of:

Code: Select all

oldprint = print
function print(...)
  local a = {...}
  if #a == 1 and type(a[1]) == "table" then -- only printtable if there's one argument (and it's a table)
    printtable(a1)
  else
    oldprint(...)
  end
end
This will print things in the standard fashion if there's more than one argument, or the one argument isn't a table. Only if you call print with one argument, that is a table, will it do printtable. (The reason for this is because trying to reconcile printtable with print's standard formatting is an exercise in tearing your hair out :cry: )
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: This is not sparta..? I am lost ;_;

Post by Robin »

anjo wrote:There's your basic printtable function.

We can also get more complicated and implement recursion through tables inside tables...
<snip />
Only if you call print with one argument, that is a table, will it do printtable. (The reason for this is because trying to reconcile printtable with print's standard formatting is an exercise in tearing your hair out :cry:)
See? That's what I mean. It's horrible. Horrible, I say!

Other than that, Lua's nice. But for most things that don't involve LÖVE, I prefer BrainFuck (if you know what I mean ;))
Help us help you: attach a .love.
Raider
Prole
Posts: 11
Joined: Fri Jul 31, 2009 12:49 pm

Re: This is not sparta..? I am lost ;_;

Post by Raider »

:x

Threads are not transformers which become vehicles for discussion about Python vs Lua.

(Even if it IS balanced and both parties are making perfectly calm, logical points about the advantages and disadvantages.)
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: This is not sparta..? I am lost ;_;

Post by Robin »

Raider wrote:Threads are not transformers which become vehicles for discussion about Python vs Lua.
They are in the LÖVE CLUB. Here, on-topic posts are rare collectors items (especially in good threads :P).
Help us help you: attach a .love.
User avatar
Pliskin09
Citizen
Posts: 89
Joined: Fri Jul 24, 2009 8:30 am

Re: This is not sparta..? I am lost ;_;

Post by Pliskin09 »

I did well in my english essay today.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: This is not sparta..? I am lost ;_;

Post by TechnoCat »

I just let my cat inside.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Khoram and 247 guests