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 DBC Challenge Hub

Author
Message
Libervurto
12
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 9th Jul 2012 05:57 Edited at: 4th Nov 2012 02:10
The DBC Challenge Arena


Challenge List
#1. Lock Picker - Make a realistic lock-picking or safe-cracking simulation.
#2. Prime Numbers - Write a program that displays prime numbers. Output can be text or graphical.

_______________________________________________________________________________________


About
Since there's no longer enough traffic on this board to facilitate regular coding challenges like we used to have on The Dark Basic Challenge Thread, I thought I'd make an open thread where people can submit challenges and solutions to each other's challenges at their leisure. I think the challenges have been an important part of the community as a way to share and learn from each other, so hopefully this will keep that spirit alive. You can grab old challenges right from the DBC Challenge Thread and post them here if you like.

Posing New Challenges
Please post any interesting challenges you think of, I will try to keep track of this thread and add new challenges to the OP. If you want to pose a challenge please do so in the following format:

****************************
NEW CHALLENGE: [Challenge Name]
[Challenge description.]
****************************

Posting Solutions
Please do not include external media with your final submission, these are coding challenges so everything in your program should be generated by the code. Feel free to post your work-in-progress and ask for help but only use the below format when submitting a completed entry:

----------------------------------
SOLUTION: [Challenge Name]

----------------------------------

Shh... you're pretty.
Fluffy Rabbit
User Banned
Posted: 9th Jul 2012 06:10
Sounds like a lot of fun, OBese. Picking locks is what every gamer dreams of doing.
Libervurto
12
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 9th Jul 2012 06:25
Yup, and I've always thought it wasn't done very well in games.

Shh... you're pretty.
BN2 Productions
15
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 10th Jul 2012 21:33
Interesting, I've been wanting a good distraction program to make (my main projects get a bit boring from time to time so its nice to have another one that's just for fun).

I should probably have my version done in a day or two.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
BN2 Productions
15
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 11th Jul 2012 23:37 Edited at: 12th Jul 2012 16:16
Sorry for the double post, but here is my entry:

----------------------------------
SOLUTION: Lock Picker

----------------------------------

This is seriously one of the most beautifully formatted programs I have ever written (mostly because I lined up the SELECT cases). I was also trying out a new(ish) structure method that worked out quite well. The switchboards control what part of the program is done. I've done similar things, but never to the full extent like this one (where everything is controlled via switchboards rather than eventually splitting off).

Comments, concerns, and insults are appreciated.


[EDIT] Removed line 248:enable escapekey . It was in there for debugging purposes and I forgot to remove it.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Libervurto
12
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 31st Oct 2012 01:27 Edited at: 31st Oct 2012 02:03
****************************
CHALLENGE: Prime Numbers
Write a program that displays prime numbers.
****************************

Here's my shabby example:


And here's the shabby output:


[edit]

Made a slight improvement with a huge effect on the processing time:

Now I'm not bothering to find products of composite numbers (non-primes) because I know they will not be unique values. Note that I decrease "i" to make sure I don't get rid of powers too soon. For example: the only product of two numbers that is equal to 27 is 3 x 9, so when n=3 we don't want to count i upwards or we'll run into 3 x 3 = 9 first and add 9 to the composite list before we've used it. Since 9 is a power of 3 this gives me another idea of how to do this...

Shh... you're pretty.

Attachments

Login to view attachments
Silverman
12
Years of Service
User Offline
Joined: 18th Jan 2007
Location: France
Posted: 3rd Nov 2012 16:40 Edited at: 3rd Nov 2012 20:41
hi everyone,

my entry (very fast,~500 milliseconds):
----------------------------------
SOLUTION: Prime Numbers

----------------------------------

EDIT : small improvement

DirectX 9.0c (February 2010)/ DBClassic v1.20

Login to post a reply

Server time is: 2019-06-25 10:28:50
Your offset time is: 2019-06-25 10:28:50