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.

Newcomers DBPro Corner / i can't figure out whats wrong with it

Author
Message
The Real 87
20
Years of Service
User Offline
Joined: 3rd Mar 2004
Location: somewhere between 86 and 88
Posted: 7th Mar 2004 07:12 Edited at: 7th Mar 2004 07:13
This was going to be an entry in the 20 line chalange but it doesn't work

I spent an hour writing it (i am very new) and then minutes checking it for correctness. Why is line 18 not nested correctly?

I get this problem a lot what am I doing wrong?

And I have Dark Basic Pro

Badger badger badger badger badger
Mushroom mushroom
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 7th Mar 2004 07:25
It's because the "20 line challenge" is the stupidest thing known to man! Learn how to code. Forget X-Line-challenges, they only promote bad coding practices! I don't know any professional programmers who use ":" and "goto" in their code.

If you are getting a NEST error it usually means an ENDIF or some other block ending identifier is missing

"What the... Moooooooo!"

test
The Real 87
20
Years of Service
User Offline
Joined: 3rd Mar 2004
Location: somewhere between 86 and 88
Posted: 7th Mar 2004 07:29 Edited at: 7th Mar 2004 07:30
did you look at the code?

And I'm no professional I've been prgramming for a week let me learn.

Badger badger badger badger badger
Mushroom mushroom
Saikoro
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: California
Posted: 7th Mar 2004 08:14
...well one thing is for sure, you are no professional...

I looked your code over, butchered it some, found your problem (its DO-LOOP not DO-REPEAT) and am now giving it back to you.

If you need the dang defense and stuff, then put it back in, but I got rid of it as there is no use for it. In fact, this whole code is pretty low-tech if you ask me. Im not usually like this, but you know the manual and help file are actually helpful and worth reading. I mean come on, you have ends in the middle of your code and DO REPEAT literally made me lol. You were also missing an endif.

Here is your butchered code:



...and here is your slightly modified code:



Good luck on the 20-liner, you'll need it...

-Vash the Stampede

Intel Pentium 4 3.0 Ghz 1024MB Ram NVIDIA GeForceFX 5200 128MB 19" LCD DVI Viewsonic

Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 7th Mar 2004 13:02
@Vash and CattleRustler: oh dear ...some people where obviously born l33t and started coding 3 minutes out of the womb, can the attitude guys, I would like to see your first ever attempt at anything code related, we could all do with a good laugh.
The twenty liner is just a bit of fun and as much a test of skill as anything else, and as for bad coding practises, so what!?, if it works with bad code then it`s infinitley better than some OOP .net masterpiece that doesn`t, or is just plain boring, or badly derivative, originality matters more than style IMO, why do you take the trouble to answer a post if you just want to insult somebody?, go join a chat group or something and vent your spleen there.

@rogue the camper: you do realise camping is only gonna work until someone works out where you are
you have made some small mistakes with the code and how it works, a lot of the commands are used in pairs or sets, for-to-next, repeat-until etc, this is not like english where you could make a sentence structured like for-while-until, that would not be allowed in B.A.S.I.C, you could also add some stamina so the the defence reduces the stamina of the opponent or something.
The best way to write your twenty liner is to start off with one command per line, then when you get it all working you can start to condense it down into less lines, goto is usualy frowned upon but in example code like the twenty liners can allow you to do more than an OOP minded person could .
Ignore the trolls above, for a twenty liner it`s actualy not bad (check my twenty liner..."nice pong" for bad ), all you need to do is check the help and examples to see how they use the commands and what is allowed, sort out the nesting error with the incompatable commands and it will work, oh!, and leave in the blocking and add something to it just to annoy the trolls

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, ATI radeon 9800 pro gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.
Don Malone
21
Years of Service
User Offline
Joined: 27th Apr 2003
Location: Birmingham, Alabama
Posted: 7th Mar 2004 14:22
Twenty Line challenges can be fun and a challenge I am sure but if you are just learning work on learning the basics and proper coding for readability. By using good coding practices and indention as a part of good programming, it gets easier to find your mistakes.

There are a lot of commands to learn and keep straight. Just look at the available loop commands. A little time there will make your twenty line challenges easier, and hopefully make it easier for you to debug your own codes.

The behavior you received here was not entirely fair. It seems they think you are taking to big of a leap with your programming just as you would not leap off the deep end of the pool the first time you try to learn to swim.

Good luck with your learning.

Wasting CPU Cycles since the 286 was a hot machine.
Saikoro
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: California
Posted: 7th Mar 2004 17:55 Edited at: 7th Mar 2004 17:55
Sry bout my attitude back there, was having a bad day, didnt mean to take it out on anyone.

It just dissapoints me when someone comes here within the last 2 or 3 days, completely ignores the 3 sticky posts at the top with tuts for noobs, and decides that however they program will be right. I know its bad to shatter confidence, and I hope I didnt do so, but if you are not going to get pointed at when you do something wrong, how will you ever learn?

Hey, at least I fixed the code.

-Vash the Stampede

Intel Pentium 4 3.0 Ghz 1024MB Ram NVIDIA GeForceFX 5200 128MB 19" LCD DVI Viewsonic

The Real 87
20
Years of Service
User Offline
Joined: 3rd Mar 2004
Location: somewhere between 86 and 88
Posted: 8th Mar 2004 04:01
You did help but i still had a few bugs to figure out for my self. Like ending the game when you run out of health and killing the boss.

You were pretty mean to me but it's cool I expected it (as I am not a good programer (yet)).

This is not my first game I did make a simple game where you walk around in rooms (text based) and clear out the goblins in side. Then you face the troll at the end of teh dungion (I never finished tho It took like 3 days just to make the skeleton).

I am not as new as I said above I did make a basic FTP that I am debugging and I am working on a 2D game. But I did teach myself (I'm 15 with computer illiterate parents, friends, and computer teachers) so of coarse I make mistakes (and huge ones at that). I did do the Binarymoon tutorial and the tutorial out of the book.

Well anyways thanks for the help.

Badger badger badger badger badger
Mushroom mushroom
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 8th Mar 2004 05:15 Edited at: 8th Mar 2004 05:17
@Mentor: Wow. First of all I wasn't trying to flame Rogue The Camper, I was flaming the concept of 20 line challenges in general, and the fact that a person new to programming was attempting it. I didn't come out of the womb knowing how to code and I have written some pretty ugly crap in my day! Don't project your guilt or drama on me as if I was looking down my nose at the kid - that's horse crap, and you know it.
Secondly, I have been here long enough and have gone well out of my way enough to help people not to deserve being called a "Troll" - I may be a lot of things (good and bad) but the last thing I am is a forum troll. You owe me an apology, as I will apologize to Camper if he feel's I came off like a snot, that wasn't my intention and I apologize.


"What the... Moooooooo!"
The Real 87
20
Years of Service
User Offline
Joined: 3rd Mar 2004
Location: somewhere between 86 and 88
Posted: 8th Mar 2004 05:27 Edited at: 8th Mar 2004 05:29
Well by coming out of the womb programming he just ment we all had our time that we needed help and programing is not something you just know like talking, or walking.

And what does "@rogue the camper: you do realise camping is only gonna work until someone works out where you are" mean

I play Counter Strike (CS) and in CS I stay in one place with a high powered rifle (camping) and my original name in CS was rogue so rogue the camper evolved, I am fat and lazy and would die if I camped in foreals

Do not apologize to me, I must face the consiquenses (if i spelled that right then hell froze over) of my stupidity (don't ask me who said that cause I have no idea)

Badger badger badger badger badger
Mushroom mushroom
The Real 87
20
Years of Service
User Offline
Joined: 3rd Mar 2004
Location: somewhere between 86 and 88
Posted: 8th Mar 2004 08:05
And why is Goto frowned apon?

It gets the job done for such simple code as this

Badger badger badger badger badger
Mushroom mushroom

Login to post a reply

Server time is: 2024-11-11 09:28:51
Your offset time is: 2024-11-11 09:28:51