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 Professional Discussion / - DBPro Coding Challenges -

Author
Message
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 8th Jan 2007 16:43
How long is this challenge going to go on?

Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 8th Jan 2007 23:38
The Christmas challenge finished two days ago. The voting for the best entry finishes at midnight tonight .... then we're back to the normal challlenges again.

NA170425
User Deleted
Posted: 9th Jan 2007 02:35
I vote for Monocoder, I like the way the snow piles up and the powerups really add to the fun.

Only about 4 hours left, here's the current stats:

Monocoder
Sixblades
Ric

Quote: "Gimme teh code!"

Thank you for not flooding the forums with posts like this.
xCept
23
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 9th Jan 2007 03:27
As always, there are a number of very well-done entries. My vote goes to Monocoder for his snowflake collecting game, I liked the simple gameplay and cool powerups.

P.S., 18,126 (Level 6)
Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 9th Jan 2007 03:45
That makes it 3-all! Please somebody submit a casting vote before midnight - I don't know what'll happen if we get a tie!!

Hobgoblin Lord
20
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 9th Jan 2007 05:19
I have to cast a vote (assuming I get one) for mono coder, the game was original, fun, and well done.

RiiDii
21
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 9th Jan 2007 09:54
And mono coder pulls out from behind to take the win!


Open MMORPG: It's your game!
Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 9th Jan 2007 11:52
Congratulations Monocoder! I'll contact David to let him know the result.

Onto the next challenge ... Aclepage was the previous winner, so it's for him to set the next one.

Just a reminder for any newcommers to the challenges, we're back to normal now which means no media once again.

sixblades
21
Years of Service
User Offline
Joined: 30th Jul 2004
Location:
Posted: 9th Jan 2007 15:45 Edited at: 10th Jan 2007 06:21
Congratulations for your win, Monocoder! I must admit, your game had originality, made excellent use of the basic 2d commands, and I fully appreciated the dynamic terrain you used . I hope that you find a good use for the prize and I hope to see you in further challenges (which I hope to take a regular part in, something which is going to be difficult with finals coming up...).

Anyway, congratulations again for winning the contest; I thank all that voted for me, you have inspired me to try to become a more active member of this community. Merry (albeit late) Christmas!
David Gervais
Retired Moderator
20
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Montreal, Canada
Posted: 9th Jan 2007 19:21
Congratulations Monocoder, Your prize awaits. I sent you an email check your in-box and send me a fancy reply. I got all my pixels lined up and ready to go.

Cheers!
Blobby 101
20
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 9th Jan 2007 20:03
late again I'm always late for this kinda thing!
do you think you'll run the challenge again next year? maybe, if David doesn't mind, with more of his great media!


perfection is not achived, it is earned.
Nicholas Thompson
21
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 9th Jan 2007 21:24
Considering how well it went I'd imagine/guess this might happen again before next year...

[center]
NA170425
User Deleted
Posted: 9th Jan 2007 21:40 Edited at: 9th Jan 2007 21:42
Congratulations Monocoder.

I'd like another one of these challenges next year, this should become a yearly thing. We just need more entries, I probably would've won if the deadline wasn't extended.

Quote: "Gimme teh code!"

Thank you for not flooding the forums with posts like this.
acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 9th Jan 2007 22:56
Next Challenge:

a random maze creator

Your code should create a maze (2D or 3D). There must be a way to solve the maze (a path from start to finish). Maze can be any shape or size. The maze should be random, in that each time you run the code, it creates a different maze.
I am looking for a graphical representation of the maze on screen, so that I can try and solve it. Feel free to add code to make it into a game.

Challenge completion date: Jan. 19

( 2b || !2b ), that is the question. The answer: true
Nicholas Thompson
21
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 10th Jan 2007 00:10
No sooner said than done

I like having a code repository on my computer




That produces a 2D map of a fully completable (with 1 solution) maze). It was used to make... Primitive Maze

[center]
Peter H
22
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 10th Jan 2007 00:13 Edited at: 10th Jan 2007 00:13
great job monocoder!

got me beat at level 9, with 30818 for a score. really creative idea! (like tetris on steroids lol)

One man, one lawnmower, plenty of angry groundhogs.
acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 10th Jan 2007 00:17
@Nicholas Thompson:
I compiled your code and got the following error:

Command out of place at line 167

( 2b || !2b ), that is the question. The answer: true
Hobgoblin Lord
20
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 10th Jan 2007 00:22
Here is one I shot out before. it adds rooms to the maze as well. It is set to draw the maze while you watch but that can be turned off easily.





His code compiled fine for me, any chance you missed copying a line or two

MonoCoder
20
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 10th Jan 2007 00:25
Whoa, and I thought it was going to be a close second! Thanks to you all for your comments and votes, and of course, great work from- and well done to- everyone else who entered. I feel inspired to start attempting these challenges more regularly sometime soon. In the meantime, I may take the game further and develop it into a full-media version.

@Code Dragon - Heh, I posted in the last half hour of 2006!
@David Gervais - This is a great prize, but I'll need a little time to consider what'd be the best request. I'll email back when the epiphany strikes. Thanks!
@Acelepage - Sorry for jumping in after you set the challenge...


Uber Tails fan. monocoder.spaces.live.com http://MonoCoder.bebo.com
Nicholas Thompson
21
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 10th Jan 2007 00:26
@acelpage - compiles fine for me too.. I'm running DBP 6.2c in the default IDE.

[center]
David Gervais
Retired Moderator
20
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Montreal, Canada
Posted: 10th Jan 2007 17:35 Edited at: 10th Jan 2007 17:48
Monocoder, please reply to the email I sent if you recieved it, my email is sometimes wonky, it will help ease my mind if you sent a reply. Just a confirmation will do. you decide when you have needs for graphics.

Cheers!

@ Nic, I get the same error at line 167.. I'm running V1.063. I checked the code and it seems fine, might be the nested 'while' that is causing the problem. the line 167 is a blank line immediately following the 'endwhile' command.
Nicholas Thompson
21
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 10th Jan 2007 18:07
I'll upgrade to 1.063 and take a look - wierd issue!

[center]
xCept
23
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 10th Jan 2007 21:24
I get the same error as acelepage when compiling NT's code in the default IDE, I'm using 1.062c. Compiling it through BlueIDE works fine.
acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 10th Jan 2007 22:53
@Nicholas Thompson:
Troubleshooting is difficult if you cannot re-create the problem, so I gave it a go. After much trial and error, I found the culprit. On line 113, there are 3 dots at the end of a comment line. The compiler seems to think these are not a comment, as it generates the error mentioned above. If you remove one of the dots, it compiles fine.

As for the root cause of the problem, I could not guess.

( 2b || !2b ), that is the question. The answer: true
Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 11th Jan 2007 01:56
Sounds like the old concatenation scenareo. Three dots is often the signal for the default ide (see system options) to append the next line to the current one. Why it would ignore the inverted comma, though, I don't know - maybe it's a bug in the ide.

acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 11th Jan 2007 02:13
That explains much Ric. If it concatenates the next line, then the next line becomes part of the comment. Although I removed the 3 dots from line 113, the code did not do anything when compiled. There are other comments with 3 dots, which in effect, is editing out some of the code.
That also explains why the IDE displayed error on line 167, but highlighted line 170 (3 lines were concatenated into comment lines, so the internal line count did not match the IDE display).

( 2b || !2b ), that is the question. The answer: true
Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 11th Jan 2007 09:05
Quote: "If it concatenates the next line, then the next line becomes part of the comment"


Yes - that does make sense. I remember running into these problems before, and changed my concatenation symbol to >>> in the default ide, as ... seems to be relatively common at the end of peoples comments.

Nicholas Thompson
21
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 11th Jan 2007 10:22
Whats even wierder is that I haven't changed the concat text and in the default editor for me, its "_" (underscore).

Nicely debugged!!

[center]
xCept
23
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 11th Jan 2007 17:25
I have never been able to locate the setting in the default IDE to specify which concatenation character(s) to use.
David Gervais
Retired Moderator
20
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Montreal, Canada
Posted: 11th Jan 2007 20:03
In "Tools", 'System Options' menu.. Colors/Styles tab,..Bottom part of the dialog that opens. Concatenation characters...

I hope this helps.
xCept
23
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 12th Jan 2007 03:07


This is all that shows up in the System Options menu.

I seem to recall reading another thread ages ago in which other users reported the same issue (no concatenation option) but I don't know what if any solution there was.
RiiDii
21
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 12th Jan 2007 06:30 Edited at: 12th Jan 2007 06:30
Lol. Sure, as long as you don't click on the Editing tab.




Open MMORPG: It's your game!
David Gervais
Retired Moderator
20
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Montreal, Canada
Posted: 12th Jan 2007 10:45
My bad, I thought the color/style tab was open on mine. Sorry. Yes RiiDii thanks for catching my error. (Click on edit tab, which for some odd reason is the default when you open the options menu)

Cheers!
xCept
23
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 12th Jan 2007 18:45
Ah, I finally figured it out. My "Editing" tab still didn't have those settings shown in RiiDii's screenshot:



Then, I realized that I had never bothered to upgrade the default IDE to 1.09b for the past four years since it's been available . Now it all works fine.

Thanks!
Daemon
20
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 13th Jan 2007 00:35
This can't be an entry since I already made it. Since it is so similar to what the challenge asks for I thought I would just show it anyway. This can find from point a to b once you designate them, and you can make more than one set of these points.

Because of the maze algorithm the dimensions must be odd. I suggest a width of 91 and height of 71.

Controls:
Leftclick-draws walls
Rightclick-draws beginning/destination point
Spacekey-creates random maze
Enter-begins the path finding



Nicholas Thompson
21
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 13th Jan 2007 13:42
Why cant it be an entry? My code is!

[center]
acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 15th Jan 2007 22:32
Here's my attempt. I am surprised that when I run my code, it draws similarly to Hobgonlin Lord's code. Although I did not use anyone else's code, I guess we came up with a similar algorithm.



( 2b || !2b ), that is the question. The answer: true
Hobgoblin Lord
20
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 15th Jan 2007 22:50
We both wrote an algorithm to make a "perfect maze" meaning no loop backs and one true path only.

Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 16th Jan 2007 02:28
Well, this is not a 'perfect maze', but then, I do pride myself in being differnet! I was just getting started on my maze generator, going for a 'draw in some rooms and add some doors later' approach, when I realised that instead of creating a maze generator, I had created (with a bit of added colour) a 'Mondrian Original' creator!



If you don't know what I'm talking about, type 'Mondrian' into google images and you'll see what I mean!

Daemon
20
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 16th Jan 2007 23:43
Well, I reread the rules to this challenge thread and couldn't specifically find the one against me using code I wrote months ago (with no intention of using in this competition) as an entry. It doesn't really seem fair, but then again my maze is not even close to being perfect.

gadgetfreak 66
19
Years of Service
User Offline
Joined: 26th Sep 2006
Location: Kulin,WA, Australia
Posted: 19th Jan 2007 09:16
Okay. Heres my entry. Once you put in the width and height (around 10-50 is good) the maze will appear. Press space to play it. Move the view with the mouse and press or hold space to move forward. Hold control as well to go backward. If you get stuck or just want to see the overview, hold shift to temporarily change the camera to top-down.



acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 19th Jan 2007 14:25
@gadgetfreak 66:
Very nice entry. I found the mouse interface a bit touchy. It would be easier if the mouse only controlled left and right motion, and there was no up and down motion.
I started with a 40x40 maze, then quickly re-started with a 10x10 maze as I didn't have all day to solve it
Good speed too. The maze is generated quickly.

I did hit an error message "Array out of bounds" once. It seems I went through an outside wall. Also, at the end of the maze, it hits a "function in mid-program. It would just need an "end" statement after to last "loop" statement.

( 2b || !2b ), that is the question. The answer: true
Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 19th Jan 2007 16:54
Here's my circular maze generator. On first glance it might look like a series of concentric circles with random walls and doorways (which is how it started, but it was way too easy!), but it is actually a bit more complex. There should be only one solution, but there should also be some opportunity to get lost too - obviously it would be easier to get lost if you were actually in it!



Parrot
19
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 19th Jan 2007 22:10 Edited at: 20th Jan 2007 00:58
Okay, I've made a 3D maze generator. It includes dead ends, and corridors that may randomly be wide or narrow. Collision routines allow you to slide along the walls. All coded from scratch.

There's a on-screen map you can follow. Green represents your starting location, red represents your goal. You'll know you've reached the end when you see the coveted Cube of Victory!



Let me know what you think. I'm kind of new to dbpro and this is pretty much my first completed 3D program.

That's the thing about guessing, 90% of the time it's 50/50
acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 20th Jan 2007 00:48
I gave it a try and it looks good, except the second time I tried it, it generated a maze that can not be completed.
Here's the screen shot. You can see in the overhead view, the green dot cannot get to the rest of the maze.

Other than that one time, it seems to work good (had to adjust the movement a bit to compensate for my slow processor).

( 2b || !2b ), that is the question. The answer: true
Parrot
19
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 20th Jan 2007 01:00
Hmm... strange, that's never happened to me in all my testing. I guess I'll have to do a little bit of tweaking. Must be some rare fluke conditions that cause it to do that.

That's the thing about guessing, 90% of the time it's 50/50
gadgetfreak 66
19
Years of Service
User Offline
Joined: 26th Sep 2006
Location: Kulin,WA, Australia
Posted: 20th Jan 2007 02:01
thats funny, none of that happened in the 100 or so times i tested it..although i'm aware there are other bugs. I kinda concentrated on the generation and then quickly chucked in the ability to play it just before i posted it. For instance, it will crash if you try going back out of the maze at the start, and also on the rare occasion that you start in a corner. I've never seen that problem at the end though, for me it just quits whenever it finds theres no more code there.

acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 20th Jan 2007 02:18
@Parrot:
I probably could not get it to do it again. Just a lucky hit on my part. I'll go get a lottery ticket now.

( 2b || !2b ), that is the question. The answer: true
acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 20th Jan 2007 02:20
@gadgetfreak:
It was probably me going out of the maze at the start. I was having some trouble with the mouse control, and didn't know which way I was going. When I tried to go through the wall again, I could not.
The end of program message may be due to my compiler/IDE, which is probably different version to yours.

( 2b || !2b ), that is the question. The answer: true
acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 20th Jan 2007 05:49
Well, it's almost midnight where I am, so I will pass judgment.

For a quick maze generator, nice display, (and a game interface to boot), I choose the winner to be:


with a close runner-up position going to:


Thanks to all other entrants:

Daemon: the smart maze (solves itself)
Hobgoblin Lord: the perfect maze (one solution, and only one)
Nicholas Thompson: the infinite maze (no escape)
Ric: the different maze (nothing straight about it)

( 2b || !2b ), that is the question. The answer: true

Login to post a reply

Server time is: 2026-07-18 01:54:32
Your offset time is: 2026-07-18 01:54:32