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 / The DB Classic Programming Challenge Thread

Author
Message
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 27th Apr 2008 14:56
@LBFN:
Nice improvement, I like what you did with the pointer!

@TDK:
I had the same problem as LBFN, I don't think the 'set object ambient' command works in the uninhanced version of DBC.

@Latch:
I just made a maze generator using your instruction, it's amazing! Thanks.


What are the chemical formulae of:
Sodium Nitrate, Gallium, Manganese and Einsteinium
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 27th Apr 2008 16:37
Quote: "Is this included in v 1.2?"


Yes - I'm sure that it was agreed many pages back in this thread (when V1.2.0 was released free) that we would all switch to it for these challenges.

If anyone hasn't got it, then you can obviously just Rem out the new Set Object xxx commands and programs will still run - but not appear quite as intended.

TDK_Man

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 27th Apr 2008 21:21
Quote: "it was agreed many pages back in this thread (when V1.2.0 was released free) that we would all switch to it for these challenges."


I thought this was unresolved because people that didn't purchase DB from the website were out of luck in getting the upgrade after the upgrade was removed from general access.

@Nano
Quote: "I just made a maze generator using your instruction, it's amazing! Thanks."

I'm glad the explanation was useful! You're talking about the "classic" maze right?

Enjoy your day.
LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 27th Apr 2008 22:14
@NanoGamez guy
Thanks

@TDK
I was just curious. I remember that v 1.2 was agreed upon in the past and I figured the command must work in it.

LBFN
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 27th Apr 2008 23:05
@Latch:
Yeah, the classic one.


What are the chemical formulae of:
Sodium Nitrate, Gallium, Manganese and Einsteinium
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 28th Apr 2008 18:37
Is the challenge over?


What are the chemical formulae of:
Sodium Nitrate, Gallium, Manganese and Einsteinium
Tone3e
19
Years of Service
User Offline
Joined: 17th Feb 2007
Location: here
Posted: 29th Apr 2008 04:28
Yes I am sorry I didnt respond earlier. There were some good entries but the winner is.



Runner up:


[center]
Come see the WIP!center]
Sinani201
19
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 29th Apr 2008 04:33
Congratulations to NanoGamez Guy, and I'm looking forward to seeing the next challenge.


Kirby is in my avatar because he rules. Live with it!
LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 29th Apr 2008 05:06
Congratulations NanoGamez guy! Really nice work.

LBFN
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 29th Apr 2008 19:06 Edited at: 29th Apr 2008 19:07
@Tone3e
Thanks

@Sinani and LBFN
Thanks guys!

Ok, the next challenge:

The Brain Challenge

Specification

Make a program that will test the mental ability of the person who uses it. For example:
-Arithmatic
-Logic
-Reactions
-Psychic ability
-etc...
but the program should only test one ability. Of course, you can submit multiple entries with different tests. The program can be in 2D or 3D. All entries must contain a scoring system.


Deadline
[i]As this is a very open challenge and I hope there will be lots of entries - 2 weeks - Midnight GMT, Tuesday, 13th May


I hope this challenge will atract lots of entries because it is easy but could be challenging to develop.


What are the chemical formulae of:
Sodium Nitrate, Gallium, Manganese and Einsteinium
Tone3e
19
Years of Service
User Offline
Joined: 17th Feb 2007
Location: here
Posted: 30th Apr 2008 01:38
Your welcome.
I think there is a game like this for the ds. Good idea. I was planning on making a game like this actually to practice for my NCAL matches(Nerds going agains nerds from other schools), but thats over now. I'll get to planning what to code.

[center]
Come see the WIP!center]
Sinani201
19
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 30th Apr 2008 01:57
I have an idea for a challenge; it's from a minigame in a Wii game called: Big Brain Academy : Wii Degree.
But to do that, I will need to combine objects. I tried a forum search, but I couldn't find anything helpful. Does anyone know a way to do this?


Kirby is in my avatar because he rules. Live with it!
LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 30th Apr 2008 02:33
Sinani201

I am not familiar with Big Brain Academy, but I assume you are asking about combining two 3D objects into one object, correct? If so, it seems you could make a mesh out of one and add it as a limb to the other. If this is not what you mean, please clarify.

LB
Sinani201
19
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 30th Apr 2008 03:12 Edited at: 30th Apr 2008 03:17
Yes, that is what I mean. Unfortunately, I am not very familiar with limbs, so can you post a code example?


Kirby is in my avatar because he rules. Live with it!
LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 30th Apr 2008 04:21
Sinani201, here is an example:


LBFN
Sinani201
19
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 30th Apr 2008 06:55 Edited at: 22nd May 2008 05:18
Thank you! Now I can start working on my entry!


The bottom half of your signature was erased by a mod because it involved Kirby.
LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 30th Apr 2008 12:36
You're welcome.

LBFN
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 6th May 2008 18:36
How far have people got with their entries?


What are the chemical formulae of:
Sodium Nitrate, Gallium, Manganese and Einsteinium
LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 7th May 2008 03:24
I'm going to have to pass on this one. I hope to get in on the next challenge.

LB
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 10th May 2008 13:59
Come on people, talk to me!
How are the entries coming on?


What are the chemical formulae of:
Sodium Nitrate, Gallium, Manganese and Einsteinium
Tone3e
19
Years of Service
User Offline
Joined: 17th Feb 2007
Location: here
Posted: 11th May 2008 02:52
sorry i dont have anything on this one either. I barely finished my Ap testing and have finals next week.

[center]
Come see the WIP!center]
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 11th May 2008 03:48
I guess it is finals time... maybe move this deadline out a couple of weeks?

Enjoy your day.
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 11th May 2008 23:02
If that alright with everyone else...


What are the chemical formulae of:
Sodium Nitrate, Gallium, Manganese and Einsteinium
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 12th May 2008 01:26
this seems like one i could enter even without a pc

It is far better to complete a 10 line program than to start a 10,000 line program.
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 12th May 2008 18:42
OK, due to finals daking place, the deadline is moved forward 2 weeks, to

Midnight GMT, Tuesday, 27th May


What are the chemical formulae of:
Sodium Nitrate, Gallium, Manganese and Einsteinium
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 13th May 2008 21:59
@Latch:

I've been playing around with your maze generator, I managed to make my own path finding system on my own!
I made a program that constantly finds paths between random points in the maze. I then finds out how much each cell is passed over and displays it on the screen using colours (rainbow). It really cool!

Anyway, I have found out that when generating the maze, using a stack system to store the stanby cells not only increases performance, it also makes the maze much better.

Here's a maze made by checking each cell to see if it's standby:


And here's a maze made using the 'stack' method:


Blue has been passed over the most, then green, yellow etc...
Tell me what you think.


What are the chemical formulae of:
Sodium Nitrate, Gallium, Manganese and Einsteinium
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 13th May 2008 23:44
Impressive!

Quote: "Anyway, I have found out that when generating the maze, using a stack system to store the stanby cells not only increases performance, it also makes the maze much better."


Hmmm, if not using the stack, there must be a tendency towards starting at the same relative room. For example, if the rooms started at the lower left and the count increased as it went to the right and up, it would most often find the standby room at the bottom or left neighbor of an active room at the lowest point in the maze. The stack, it seems, would pick up closet to the current position, where ever in the maze that might be.

From your examples, it looks like the "search all rooms" method has paths that run left to right (which would seem to support the tendency idea). Good work! Now you have to convert the 2d to 3d.

For path finding, did you use the "if there is a wall in front keep turning right" method?

Enjoy your day.
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 14th May 2008 18:38 Edited at: 14th May 2008 18:41
@Latch
Acually, I used my own system. Here's how it works:

From the starting point, the system goes along a path until it reachs a cell with more than one available path. When it does, it choses a path and records the cell position, where it came from and the path it choose into a stack.

It contines like this until it reaches a dead end. If it does so, it goes back the latest cell in the stack and makes an 'invisible wall' on the side it went through to get to the dead end.

It then choses another path from that cell. If there are no more available paths left because they have been blocked off by 'invisible walls', it goes back to the next cell in the stack.

Eventually, it finds the correct path to the end point. However, this is no the quickest possible route to the end. So, next there is a second loop, where the program begins at the start point and continues along a path. When it reaches a cell with more than one path, it will always choose the correct one because the others have been bloked by 'invisible walls'.

To ensure that the second loop always chooses the same path as the initial loop, the path to go along is chosen sequently, and not by random.

Because of the second loop, the system will always find the shortest path from A to B, as long as it's a perfect maze.

If that's not very clear, I will post the source code to explain it better.


What are the chemical formulae of:
Sodium Nitrate, Gallium, Manganese and Einsteinium
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 19th May 2008 18:43
Just over a week left, I hope there will be a few entries because this one was an easy one and there was plenty of time to do it in.


What are the chemical formulae of:
Sodium Nitrate, Gallium, Manganese and Einsteinium
Captain America
21
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 20th May 2008 17:27
@Latch

hey did you ever post the source code for that thing with the lightning and rain sound effects? I am really interested in how you coded those without any media.

I am also interested in MODing the whole thing into a FPS.

Thanks!


Cheers,
Capt. America
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 21st May 2008 10:39 Edited at: 21st May 2008 11:51
Challenge Entry:
Here's a "Simon Says" entry. The computer will light 1 of 4 orbs in a pattern. It's your job to repeat the pattern the computer plays. The computer will play the pattern then add one extra light each level so you'll have to remember the whole thing and play it back.

Oh, and if mine is the only entry, I don't think I'll set the next challenge.



Enjoy your day.
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 21st May 2008 11:08
@Captain America

Haven't seen you around here in about 1000 years!

Quote: "hey did you ever post the source code for that thing with the lightning and rain sound effects? I am really interested in how you coded those without any media.

I am also interested in MODing the whole thing into a FPS."

I never did post the source but the battle arena is Link102's and that's found earlier on this thread. The lightning texture was something I adapted from a texture comrade robski put together which can also be found in an earlier challenge on this thread. I stripped out some of the detailing and blurring so that it could be used in real time. I paired it with a random timer, changed the gamma of the screen, added some different lighting and backdrop color and voila - lightning!

As far as the sound, we aren't allowed to use memblocks for the challenges and we can't use preconfigured media. So, for the memblock situation, I used files to read and write data I might normally store and manipulate in the memory of the memblock. And since I can't use media that already exists, I have to create it myself. So I wrote a simple white noise sound generator that output maybe .25 to 1 seconds worth of a noise wave. Then I slap a wave file header on top of that and I have a usable sound file. I make it a monophonic sound so I can use the 3D sound commands in DBC. So, under water, I change the volume, the placement and the pitch of the sound. For the lightning, I use a few sounds at different pitches and volumes and trigger them with another random timer that's working with the lightning flashes. It's very similar to how an old 8 bit machine might make these types of sounds.

I really liked that battle arena of Link's and had also wanted to make it into a full blown FPS at one time. I was hoping it could be a community project but that kind of thing really never works around here.

Enjoy your day.
Captain America
21
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 21st May 2008 17:30
@Latch

Ya i have been pretty busy, have not had much time for programming lately, but now I have been able to squeeze in some time so I thought I'd check out the threads. Right now I am working on an RPG game. I'm having a little trouble so if I cant get it worked out I'll post the code. But it's good to see you to!

As for your program...

Wow! That's really creative! Do you think you could post your code on that because I have absolutely no idea on how you did that. or is there another thread in this forum that explains those commands.

Well I have to go now.

Cheers,
Capt. America
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 21st May 2008 18:46
@Latch:
Cool entry, it's simple but quite addictive. I really like the traffic light like effect you've created.


What are the chemical formulae of:
Sodium Nitrate, Gallium, Manganese and Einsteinium
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 22nd May 2008 06:45
Here's what I have to offer so far - Mental Maths Blaster!

It's a Space Invaders style mental arithmetic program, but after only an evenings work it's still very rough - so don't expect too much.



Written in V1.2.0 but I've hopefully kept it V1.13 friendly.

I've not written the hiscore tables yet - I'll do that tomorrow - and tidy it up quite a bit too...

TDK_Man

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 22nd May 2008 10:00
Pretty nice TDK!

However, it almost immediately became unplayably slow. I looked through the code seeing if there was a repeating loop that wasn't letting go or something. It turns out it was the scaling of the GO sprite. I changed the procedure GoAnim to the following and it seems to bring the game back to a playable speed:



Basically, I just reduced N's limit to 5000 instead of 10000 and then immediately scaled the sprite back down after it was hidden.

Enjoy your day.
LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 22nd May 2008 13:01
Nice game TDK! I like the way you blended the background colors and how the font looked.

Latch's change really sped it up. So much so that on multiple-digit answers, the text that was moved on the screen was unreadable for me, because it simply moved too fast. On the beginner level it worked flawlessly but on the genius level, I got problems like '16 / 16 / 250' and '15 / 30 / 19' to solve.

LB
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 22nd May 2008 16:29
Quote: "However, it almost immediately became unplayably slow"


One of the annoying things about writing stuff that others can use I guess. It ran nice and fast for me, but until others try your stuff, you never know...

The effect I really wanted was to make it appear that the Go came out of the screen and you were passing through the gap between the letter G and O - hence the 10000.

So the problem with speed for you was keeping the sprite at it's huge scaled size - even though it was hidden? OK, useful to know - thanks!

Quote: "on the genius level, I got problems like '16 / 16 / 250' and '15 / 30 / 19' to solve"


Yes - sorry, I only tweaked the first three levels to make sure they produced questions which were not too silly. As I needed to sit and play it to test what each level produced I didn't have any more time last night.

I know this challenge has fallen during exam time for many people, but at any time it's not unheard of for extensions to be requested and I basically wanted to show what could be done with DB from scratch in just one evening.

So it was bound to be a bit 'rough around the edges'...

BTW - I forgot to mention that on the harder levels, when division is used, it's all integer maths. There's no decimal point and with floating point precision, it wouldn't really be possible to work out the answer in your head if DB decided the answer to a question was 31.77724 for example.

And when testing it, you can always cheat...

TDK_Man

NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 22nd May 2008 19:08
Great entry TDK, very cleverly done. Although the GO animation did get quite annoying!


What are the chemical formulae of:
Sodium Nitrate, Gallium, Manganese and Einsteinium
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 22nd May 2008 20:02
Quote: "So the problem with speed for you was keeping the sprite at it's huge scaled size - even though it was hidden? OK, useful to know - thanks"


Partly. That was a quick fix to get it playable. It's really the sprite use on my machine. If I don't need transparency (in the case of the numbers) or I handle the refresh of the sprites myself, It increases the speed beyond playability. I tested the FPS with just the scaling change and it went from 7 to around 44. With the transparency/refresh management - over 110. So with these things combined, I have to manually set the sync rate at about 40 or 50 to keep it playable.

Enjoy your day.
Irojo
18
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 22nd May 2008 23:19
TDK... ummm That's scary... So in one night you make an epic game... And in 1 month...? What? You Make An Mmorpg???? Your scary...

I'm not one of those Geeks who sit at home and eat potatoe chips and program games. I'm one of those wannabe's.
Not_Maindric
18
Years of Service
User Offline
Joined: 10th Jul 2007
Location: Omaha, NE
Posted: 23rd May 2008 00:58
Hm, TDK, when I was messing with the genius level, I was entering the correct answers, but it says it is wrong... What is the goal for the highest difficulty? You should also add factoring problems. That should be fun. =D

Sinani201
19
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 25th May 2008 03:35
Apparently, I gave up on the cube-matching game. But I've got another idea, from the Brain Age 2 DS game!
I don't have the game, but I've downloaded a demo of it several times. The demo brain exercise is the rock-paper-scissors game. What I have so far is the same exact concept, but instead of shouting into the computer what your answer is, you just click on it.
But, unfortunately, I've ran into a problem. When you answer the first one correctly, the program runs into the function declaration at the end, even though it's supposed to repeat the same concept 9 more times! I'll post the code here.



The bottom half of your signature was erased by a mod because it involved Kirby.
LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 25th May 2008 04:58
Sinani201

I can't say I've played paper, rock, scissors quite like this.

You only need to randomize timer() once.

There are two problems:
1. Your for-next loop uses the variable t, but you set T=timer() (it doesn't matter whether it is capitalized or not). This ends your loop as soon as the first 'next' statement is processed.
2. You need to end the program or restart it right after 'next t' and before the subroutine 'setup' begins.

LBFN
Sinani201
19
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 25th May 2008 23:33 Edited at: 25th May 2008 23:34
Quote: "I can't say I've played paper, rock, scissors quite like this."

LOL, I haven't really either. This is just a tweaked version to trick your mind. But anyways, thanks for helping!


The bottom half of your signature was erased by a mod because it involved Kirby.
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 27th May 2008 14:59
OK, last day today,
Eevryone who hasn't posted their entries had better do it soon!


What are the chemical formulae of:
Sodium Nitrate, Gallium, Manganese and Einsteinium
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 28th May 2008 04:03
Got the hiscore table added, so here's my final entry version.

There's no end to the game and the puzzle generation side of things could do with a lot of improvement, but it's not turned out too bad considering how little time I've spent on it!

Just press Q while playing the game to quit and your score gets placed on the Hiscore table if it's good enough.



I might at some time finish this off and add an options screen, music and sound effects as it's not a bad little game for anyone with young kids learning early level maths...

TDK_Man

Sinani201
19
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 28th May 2008 05:24
For some reason, you can't press rock, but besides that, it's done.




The bottom half of your signature was erased by a mod because it involved Kirby.
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 28th May 2008 12:49 Edited at: 28th May 2008 12:51
OK, challenge over. I was slightly dissapointed at the number of entries - as there was 4 weeks to do it in. However, I do appreciate that it was finals time and so some people didn't have time for it. Enough of my rant, here's the entries:

Latch:
Nice idea that was really quite addictive. I liked the 'traffic light' effect, although the rest wasn't as pretty!

TDK:
A cool idea combining maths with a bit of action! The animations were a nice touch and the menu made it feel more like a full game. I thought it looked a bit cheesy, but thats just my opinion!

Sinani:
A very good concept that was challenging but fun. I like because it makes you think of multiple things at once in a very clever way. Given a bit of time, that could develope into a very nice little game. Of course, the graphics did let you down.

The runner up is:


An the Winner:


Over to the winner to set the next challenge.


What are the chemical formulae of:
Sodium Nitrate, Gallium, Manganese and Einsteinium
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 28th May 2008 23:26 Edited at: 29th May 2008 08:26
Having just had to add a Hiscore routine to my entry in the last challenge - and a very basic and boring one too, (all I did was print the ten names and scores onto the screen), it gave me an idea for this challenge. Which is...

Create A Flashy Game Hiscore Screen

Calculating the hiscore numbers, names and positions isn't important - you can use the code from the Mental Maths Blaster entry if you are not sure how to do it - or just use pre-defined arrays of ten names and scores.

What is important is that you come up with a good looking, novel or unusual screen and you must be able to read the ten names and their associated scores - how you do that is entirely up to you.

Sprites, animation, particles, 2D, 3D - whatever your imagination can come up with.

You have one week - challenge closes Midnight GMT on 5th June.

TDK_Man

Login to post a reply

Server time is: 2026-06-07 19:39:14
Your offset time is: 2026-06-07 19:39:14