Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / do you have to use a array?

Author
Message
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 29th Mar 2009 23:41
is there anywhere when you NEED arrays?can you just call out your varibles the normal way?
-I know you use arrays for organization and thats it.-

im new at this
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Mar 2009 23:45
you have had people explain how to use arrays to you and you have made several threads about the same subjects.
You are cluttering up the board.
As you have seen we are all happy to help but please take that help on board and try to use it before starting new threads.

The Universe has been erased by a mod because it was larger
than 240x80 pixels.
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 29th Mar 2009 23:49
i was just wondering if u have to use them.y/n

im new at this
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 29th Mar 2009 23:52
and have you seen how many random Q's THAT1SMARTGUY has made.

im new at this
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 30th Mar 2009 00:02
mine r all different tho, i dont post several threads on the same thing, xcept maybe the poker game im regretting the 2nd post sorry bout that
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 30th Mar 2009 00:06
ok, i'll do my studying and if i can't figure it out then i'll leave a post.(i'll stop being lzy)

im new at this
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 30th Mar 2009 00:13
to answer ur question no u dont have to use arrays, they serve the same function as variables, but in a much more organised fashion, i cannot see why u wouldnt use arrays tho
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 30th Mar 2009 00:16
@Razer
you're right other people have done the same you were just at the top of the board.
I've left a post on your data thread that uses arrays so that should help you understand them too.

The Universe has been erased by a mod because it was larger
than 240x80 pixels.
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 30th Mar 2009 00:17
and btw razer tnx 4 singling me out of ev1 in the forums for ur example
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 30th Mar 2009 00:28
ok thats enough bickering
you've both learned not to post multiple threads on the same subject so lets leave it at that.

The Universe has been erased by a mod because it was larger
than 240x80 pixels.
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 30th Mar 2009 00:31
well on topic.

they are very useful when you need a lot of variables for different objects(for 3d) or images(for 2d) then it's not img1 img2 img3 its img(1),Img(2),img(3) and plus for functions and stuff(if declared outside the function) they are the only way to get global variables (unless u use extended syntax on darkedit but all that does it change those variables to arrays when you use em)


all in all i would say clearness i think it's easier to read code and find problems if you using arrays. and the global part which comes in very helpful.

there are a hole lot more reasons but they have been explained in other posts for you. and to be honest for me i didn't just learn about them and use em i herd about em and thought i didn't need em and realized how much i did later and had to restructure everything

and you don't have to use all arrays you can use both (your post sounded lke thats what you meant)


Off topic:

That1smartguy:

Do you want another rule referance?????? hahahaha

New Site! Check it out \/
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 30th Mar 2009 00:44
@caleb
smartguys hasn't done anything wrong in this thread.

and a big reason for using arrays you left out is where their name comes from; an array means a group of things (in this case, variables), so using arrays enables you to store many variables one place. Imagine you're writing a program that requires 1000 variables, it would take years to write the code for every instance of each variable.
Think about strategy games where you can have hundreds of people running around at the same time, each of their data needs to be stored somehow, and that's by using arrays.
note: you could use memblocks but that is quite advanced so leave that till you have mastered arrays.

The Universe has been erased by a mod because it was larger
than 240x80 pixels.
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 30th Mar 2009 01:47
Benefits of arrays (as has been touched on, but in different words): Numeric referencing. If you use a variable, you would need an IF-THEN statement for EVERY CASE. With an array, you can do a single math equation or something and reference whatever is in that slot of the array.

Also, arrays are global, so they can be used in functions. Variables are local, so a variable called NAME in the main code would contain something different from NAME in a function.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Sixty Squares
19
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 30th Mar 2009 03:13 Edited at: 30th Mar 2009 03:20
Say you have 200 enemies, all of whom have a certain amount of damage that they deal with attacks. The damage is random-- between 0 and 200 damage. Here are two ways to assign damages to these enemies...

No Array:


vs.

Array:


I don't know about you but I'd much rather the second .

EDIT: Oh sorry I misread your post. You may truly need arrays in a situation where you don't know how many of something there will be. For example, say you are making a level editor and you can place cubes. You don't know how many cubes the user will make, so you might as well make an array that can be expanded and contracted based on how many cubes there are. Or you could, just to be safe, make 65535 variables...

EDIT2: Oops, nevermind you can't do that in DBC... Nevermind this post

<---Spell casting battle game!
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 30th Mar 2009 03:23
nice waste of pixels sixty, lol

but ya it basically boils down to watevr u r comfortable with, variables take more time and keystrokes but if u understand em betr then use em
Sixty Squares
19
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 30th Mar 2009 03:52
Quote: "nice waste of pixels sixty, lol"


Only if you open to code box

<---Spell casting battle game!
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 30th Mar 2009 04:17
no i mean nice waste of a post, pixels just meant waste of the screen
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 30th Mar 2009 07:54
thanks for all the input,

and dont think that your post before this was useless because i may not understand it now but later it will be a great help,

sorry if i offended you smartguy all of your post have helped bunches

i look foward to sucking the knowledge out of your brains


im new at this
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 30th Mar 2009 09:12
i think the "darknoob" thingy is not even helpful to noobs because they are doing really difficult stuff thats way past my skill.does any one agree.

im new at this
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 30th Mar 2009 09:20
Wrong thread.

It is only supposed to be helpful to noobs who are on the team and participate. And, so far, we have a pretty good success rate. Ashingda, and Irojo were 2 of the earliest members, and they are pretty good coders now. Smartguy is getting better. The only people I haven't seen improve are people who a) don't do anything b) join but quit (which isn't always bad to do and even then they improve a bit, but not much)

And, if it is way past your skill, why not join? There are TONS of aspects to making a game of varying degrees of difficulty. We do our best to assign appropriate jobs to everyone, so that we don't give crazy hard jobs to complete noobs, but we don't give trivial tasks to those who know what they are doing.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 30th Mar 2009 16:27
Quote: "does any one agree."


NO

To sum it up, we do complicated stuff so that you LEARN how to use it.

~QJ
That's what they WANT you to think...
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 30th Mar 2009 17:55
ok, i'll look into it. its just every project i've seen you do is really hard looking.


i did'nt know smartguy was apart of it, hes a good programmer

im new at this
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 31st Mar 2009 02:11
thats kinda wat i think sometimes, but if u just ask about wat u dont understand then mroe often than not u learn how something works or why they used this command here, etc

and tnx razer
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 31st Mar 2009 03:08
it just looks difficult because of the volume of code, like how a page of maths questions looks terrifying until you give them a try
I played a game called Brothers in Arms: Hell's Highway; I looked at the credits and there was one guy whose only job was to make sheep and cows to go in the background You could be that guy! lol

The Universe has been erased by a mod because it was larger
than 240x80 pixels.
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 31st Mar 2009 03:13
hey, i would'nt mind makeing a cow in a cool game.

im new at this
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 31st Mar 2009 03:14
HAHAHAHAHA, also i recognize the game title, but cant seem to recall the game, hmmm
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 31st Mar 2009 03:18
[offtopic]
It was a recently released FPS for the 360, PC, and PS3. Don't know too much about it but I think it came out last fall if I remember correctly.

[/offtopic]

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 31st Mar 2009 03:25
ah

(hows that 4 a deep and intuitive post)
Bluestar4
19
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 8th Apr 2009 09:06 Edited at: 8th Apr 2009 09:07
Quote: "To sum it up, we do complicated stuff so that you LEARN how to use it."

yes but even complex things need to be made easy to understand for a beginer. but I have a challenge that seems sooo simple but in reality is sooo hard - try making a game with nothing but complete asci characters using only print,get image/paste image commands. This sounds simple at first , but do you think you can do it ? I believe you will find that its so simple , yet so complex. Now for a little trivia - Can anyone guess the one game that is famous for being successful at doing this ? The answer is enclosed in the code below


bluestar4~
---Missle Might - Hero Battles - Zillipede --- which do you like the best ?
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 8th Apr 2009 18:21
ascii can be easily converted to characters so does that count lol

New Site! Check it out \/
Bluestar4
19
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 9th Apr 2009 22:20
yes. thats the idea Caleb. All the graphics in the entire game that I mentioned above were completely done using ascii characters yet it was famous.

bluestar4~
---Missle Might - Hero Battles - Zillipede --- which do you like the best ?
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 9th Apr 2009 23:01
wow!

New Site! Check it out \/
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 10th Apr 2009 13:20
Quote: ""Do you have to use arrays""


You don't have to...

But lets say you have this code:


It would be a lot easier to write it using arrays:



Peachy, and the Chaos of the Gems

That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 10th Apr 2009 16:52
how in the world did we reach 33 posts on this?

this should have been a 1-post thread:

no u dont have to use arrays, but they r much more code efficient than variables

There are only 10 kinds of people in the world, those who understand binary and those who dont
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 10th Apr 2009 19:00
thank you every1 i've got the basics of arrays you don't have to leave any more post

im new at this

Login to post a reply

Server time is: 2025-08-08 20:42:36
Your offset time is: 2025-08-08 20:42:36