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

Pages: 1-

Prayers to Proglodite

Name: Anonymous 2009-10-10 0:51

So I want to represent a grid of cells containing x,y values.

I don't know a better way to do this than arrays of arrays of two-item arrays. Obviously this is a bad idea.

I'm sorry, /prog/. I've been reading Hobbes.

Name: Anonymous 2009-10-10 1:19

A two dimensional arrays of tuples/structs/objects?

Name: lattdddie 2009-10-10 1:31

<A href="http://aichi.awdccs.com/">出会い愛知</A><A href="http://akita.awdccs.com/">出会い秋田</A><A href="http://aomori.awdccs.com/">出会い青森</A><A href="http://chiba.awdccs.com/">出会い千葉</A><A href="http://ehime.awdccs.com/">出会い愛媛</A><A href="http://fukui.awdccs.com/">出会い福井</A><A href="http://fukuoka.awdccs.com/">出会い福岡</A><A href="http://fukushima.awdccs.com/">出会い福島</A><A href="http://gifu.awdccs.com/">出会い岐阜</A><A href="http://gunma.awdccs.com/">出会い群馬</A><A href="http://hiroshima.awdccs.com/">出会い広島</A><A href="http://hokaidou.awdccs.com/">出会い北海道</A><A href="http://hyogo.awdccs.com/">出会い兵庫</A><A href="http://ibaragi.awdccs.com/">出会い茨城</A><A href="http://ishikawa.awdccs.com/">出会い石川</A><A href="http://iwate.awdccs.com/">出会い岩手</A><A href="http://kagawa.awdccs.com/">出会い香川</A><A href="http://kagoshima.awdccs.com/">出会い鹿児島</A><A href="http://kanagawa.awdccs.com/">出会い神奈川</A><A href="http://kouchi.awdccs.com/">出会い高知</A>

Name: Anonymous 2009-10-10 1:45

Depends mostly on what language you're using, but yeah, that's pretty much it.

Name: Anonymous 2009-10-10 4:19

Obviously this is a bad idea.

Why?

Name: Anonymous 2009-10-10 4:28

datatype variable_name[x_size][y_size]
HOLY SHIT, AM I BLOWING YOUR MIND YET?

Name: Anonymous 2009-10-10 23:00

>>5

Because I feel like there has to be something more clever than arrays of arrays of arrays that I didn't think of.

I liked it better when /prog/ made me feel dumb

Name: Anonymous 2009-10-10 23:38

>>7
Like, for coming here?

Name: Anonymous 2009-10-10 23:48

>>8
No, we used to have intelligent posts on /prog/ instead of the meme recycling project it's turned into

Name: HAXUS THE RECYCLER 2009-10-11 0:12

>>9
No meme shall go to waste!

Name: Anonymous 2009-10-11 0:13

use a linked list.
linked lists are awesome.
struct node{
   struct node *prev;
   struct node *next;
   int x;
   int y;
};

delicious ◔ ◡ ◔

Name: Anonymous 2009-10-11 0:16

or an array of structures.

struct xy{
   int x;
   int y;
}x[ARRAY_LEN];

i love structures and meaningless variable names(♥‿♥ )

Name: Anonymous 2009-10-11 10:27

>>1
What are you going to achieve, what are you actually going to use the grid for?

Name: Anonymous 2009-10-11 11:42

typedef struct {
    int x;
    int y;
} cell;
cell[][] anus;

Name: Anonymous 2009-10-11 11:56

>>13

An ecology sim

Basically a grid of squares containing resources(x) and waste(y)
Actors move around making resources and leaving waste. Too much waste, death. Etc.

At some point I'll have two opposing actors, eating the other's waste and excreting the other's food.

Name: Anonymous 2009-10-11 12:01

>>15
>making>taking

Name: Anonymous 2009-10-11 12:44

>>15
OMG SYMBOSIS

Name: Anonymous 2009-10-11 13:24

>>17

Well, I could have static resources and model the problem of accumulating waste with only one actor

ANYWAY.

Name: Anonymous 2009-10-11 13:49

You all suck!

Name: Anonymous 2009-10-11 13:52

Yes you do
--
Hello world

Name: Anonymous 2009-10-11 15:22

>>15
So why the fuck did you say in >>1 that you needed x,y values? (x,y) implies coordinates, it would be easier to understand if you at least changed the letters to (a,b).
inb4 FV comes and starts talking about “nonconformism”

Name: Anonymous 2009-10-11 16:39

>>21
who?

Name: TRUE TRUTH EXPERT !!TthtFzrtPXElUy7 2009-10-11 16:43

sTOP CALLING ME fv!

Name: Anonymous 2009-10-11 20:52

>>21
YOU KNOW WHAT THEY SAY ABOUT ASSUMING.

Name: Anonymous 2009-10-11 20:59

>>21

Yeah, sorry. But how much difference does it make being a pair of coordinates versus a pair of generic integers?

I'll try not to post ideas after eating painkillers again

Name: Anonymous 2009-10-11 21:25

OKAY YOU FUQIN ANGERED AN EXPERT PROGRAMMER
GODFUCKIGNDAMN
FIRST OF ALL, YOU DONT FUQIN KNOW WHAT A MAN PAGE IS
SECONDLY, THIS IS /prog/ DO NOT DEMAND USEFUL ANSWERS THE WAY YOU WANT THEM TO BE
THIRDLY PROGRAMMING IS ALL ABOUT PHILOSOPHY AND ``ABSTRACT BULLSHITE'' THAT YOU WILL NEVER COMPREHEND
AND FUQIN LASTLY, FUCK OFF WITH YOUR BULLSHYT
EVERYTHING HAS ALREADY BEEN ANSWERED IN >>3,4,10

Name: Anonymous 2009-10-11 21:34

Damnit /prog/, why is this thread still here when >>2 answered it already.

Name: Anonymous 2009-10-12 0:55

>>27
That's a worse answer than >>10

Name: Anonymous 2009-10-12 5:20

出会い福岡

Name: Anonymous 2009-10-12 5:30

What R7RS needs is a good n-dimensional vector type.

Name: Anonymous 2009-10-12 5:35

CL already has one:

CL-USER> (make-array '(3 2 4) :initial-element 'lisp)
#3A(((LISP LISP LISP LISP) (LISP LISP LISP LISP))
    ((LISP LISP LISP LISP) (LISP LISP LISP LISP))
    ((LISP LISP LISP LISP) (LISP LISP LISP LISP)))

Name: Anonymous 2009-10-12 5:51

>>30
SRFI 25. Written in 2001, so anything other than PLT should have them out of the box. (there's a package on PLaneT somewhere for that, though)

Name: Anonymous 2009-10-12 5:54

>>32
PLT has it, just (require srfi/25)

Name: Anonymous 2009-10-12 6:01

>>33
Oh, my bad, then.

Name: Anonymous 2009-10-12 7:03

>>1
Just use a one dimensional array..

Use a macro (x,y,rowlength) to calculate offset.

Name: Anonymous 2011-02-03 0:30

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