Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

List of lists...of lists (python)

Name: Anonymous 2008-11-15 18:23

I'm attempting to make a rogue-like dungeon generator in python. I'm pretty sure everything I'm doing is terrible, but if it works, I'm happy.

Anyways, I have a list of lists of lists. How would I be able to get to the creamy nueget center of my lists? I've only done this type of thing in Scheme which basically consisted of (first (first (first lst))). How do I do this in python?

Name: Anonymous 2008-11-15 18:29

Use c[a|d][a|d]*r.

ANYWAY, I have the same question, but about Haskell.

Name: Anonymous 2008-11-15 18:33

>>2

[["LISTS OF LISTS OF LISTS"]]

Name: Anonymous 2008-11-15 18:39

>>2

awesome, thanks

Name: Anonymous 2008-11-15 18:41

>>1


>>> a = ('one',('two one','two two'),'three')
>>> a[1][0]
'two one'
>>> a[1][1]
'two two'


OR


>>> a = ('one',('two one','two two'),'three')
>>> b,c = a[1]
>>> b
'two one'
>>> c
'two two'

Name: Anonymous 2008-11-15 18:46

>>2
What does | do in python?

Name: Anonymous 2008-11-15 19:20

>>6
Binary or. Also, that is a pseudo-regular expression (i.e. the `|' is actually wrong).

Now you have two problems.

Name: Anonymous 2008-11-15 20:40

>>6
it indents

Name: Anonymous 2008-11-16 1:22

>>1
Don't ever spell ``nougat'' like that again. Jesus.

Name: Anonymous 2008-11-17 11:56

>>2
c[ad]+r
or: c[ad]{1,4}r
to be more CL/Scheme-like

there, fixed it for you... Or did you want it less efficient and accepting symbols like cad||dd|ar?

Name: Trollbot9000 2009-07-01 8:50

nueget center of my mind and get  a wrong result  single Now go  outside take some  courses I missed  and am now  going to sage  it That is  AWESOME A pie  formed like an  horiboble corruption of  C It takes  C and not  touching the stack  is an array  of base class  pointers and the  stupidest of people  who are talking  about Managed C  is for idiot.

Name: Anonymous 2010-12-23 6:56

>>2
NOVICE REGEXPER
c[ad]+r

Name: Anonymous 2011-02-03 0:28

Name: Anonymous 2011-02-03 3:07

Don't change these.
Name: Email:
Entire Thread Thread List