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
Lucifer
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 31st Jan 2007 00:59
here is an update to my code.. for some reason, my router doesnt want me to push the edit message button..




i like pancakes..
Lukas W
20
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 31st Jan 2007 09:34
Heyia,
Here is my entry for this challenge:



Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 31st Jan 2007 21:56
Here's my new entry. You can choose either a square Pencil tool, or the round Brush tool. You can control the size of the tools and the density of the Brush to create a spray can effect.



Hobgoblin Lord
18
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 2nd Feb 2007 01:59
Oh a paint challenge, hope I find some time to do something with this, have to dust off the old DBC.

Nice effects Phaelax, (round 2 perhaps )

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd Feb 2007 02:47
hah, you stole my win last time hobgoblin, I'm taking this one! If you're entering then I guess I'm not finished with my entry afterall.

It's quite a bit tougher not having UDTs or memblocks. I suppose you could technically use an array in place of a memblock, but I doubt DBC has the speed neccessary.

Hobgoblin Lord
18
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 2nd Feb 2007 05:12 Edited at: 2nd Feb 2007 05:16
DBC has memblocks dosent it?, they are in the helpfile.

EDIT: If I do find the time to enter this I doubt I will be writing a fill routine.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 2nd Feb 2007 05:55
Quote: "DBC has memblocks dosent it?, they are in the helpfile."


Yes - if you have the Enhancement pack.

But, according to rule 3, you cannot use any Enhancement Pack commands unless the challenge description states that users may use them - and of course that the majority of contestants agree that they are interested.

This is purely so as many people can join in the challenges as possible.

For the guidance of challenge judges, it should be pointed out that entries which include Enhancement Pack commands must unfortunately be disqualified (unless it's a challenge which permits the use of them).

TDK_Man

Hobgoblin Lord
18
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 2nd Feb 2007 06:53
AH, I see. As a question does it note in the help files anywhere which commands are from the enhancement pack? mine are just all together in the help.

Here is a quick start to my drawing program, just simple pencil at the moment, you can define a pallette of 7 colors by clicking on one of the boxes above the RGB sliders and adjusting its levels.



Lukas W
20
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 2nd Feb 2007 08:52
Hob,
wow reaaallyyyy sloooowwww.
I couldn't draw a perfect circle. it looked like a triangle or something. but I guess it was ok, didn't get to test it much.

So far only Phaelax and my entry runs smooth on this computer. I think we deserve some extra points for that! (jk)

Hobgoblin Lord
18
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 2nd Feb 2007 14:11
Quote: "Hob,
wow reaaallyyyy sloooowwww.
I couldn't draw a perfect circle. it looked like a triangle or something. but I guess it was ok, didn't get to test it much."


Darn, runs really fast for me, but I didn't take older machines into consideration. Not sure if I will have time to do any more work, but if I do I will see if I can speed it up.

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd Feb 2007 20:34
HL's code worked fine for me. Though I could tell it ran slower by the amount of sharper lines.

I was gonna say I got a speed boost using lock pixels, but I forgot I'm suppose to be running this in DBC. So nevermind.


I was thinking about using something like a canvas. Making all my drawing operations write to an array, then drawing that array. That'd allow me to do line and circle tools.

@HL, I have enhancements installed too, but I have the cd box sitting here so here's what it adds:
- multiplayer commands
- DLL support
- back buffer access
- memblocks

Supposedly, it adds overall 190 new commands.(and im not typing them all)

Hobgoblin Lord
18
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 2nd Feb 2007 21:25
yeah, I went to toss in a noise filter and the lack of lock pixels or memblocks makes that kind of moot. the point rgbb,rgbr, and rgbg commands slow it down way to much.

thanks for the commands. haha backbuffer was my next thought

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 4th Feb 2007 01:50
Good to see more entries!

Ok everybody in DBC land, this challenge is coming to a close in about a day. You have some time left to get your entries in!

Enjoy your day.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 4th Feb 2007 04:07
My entry so far:



Usage Notes:

To toggle the menu for drawing, click the right mouse button.

When saving a BMP, click in the filename box, type the name of the file (without the .BMP on the end) and press the Enter key.

TDK_Man

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Feb 2007 22:33
I was wondering if you were going to enter.

When you load a bitmap, it resets the pen color back to white. Looks nice, we might have a winner.

I was gonna do open/save, but I would've had to use a dll call.

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 5th Feb 2007 01:03
Well, there's only a couple minutes left as I'm writing this. By the time I'm finished, the challenge will be over.

I will review the entries and let you know the results shortly.

Enjoy your day.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 5th Feb 2007 02:00 Edited at: 5th Feb 2007 02:04
Since there were so few entries, I'll give a little detail on how
I came to my decision.



So the winner is:

TDK_Man !

The first runner up is:

Phaelax !

So TDK, I guess you set the next challenge again.

Enjoy your day.
Hobgoblin Lord
18
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 5th Feb 2007 14:30
Good job TDK, wish I had had more time for this.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 5th Feb 2007 20:43 Edited at: 5th Feb 2007 20:44
Quote: "Good job TDK, wish I had had more time for this."


Thanks - so do I!

But, since I started the idea, the least I can do is participate...

OK, I've had a few connection problems at this end, so only just got on. I have until midnight to decide on a new challenge, so I'll be back in the next 4 hours to set one.

TDK_Man

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 6th Feb 2007 00:19 Edited at: 6th Feb 2007 00:19
OK, here's the next challenge...

You must write a calculator program which is totally mouse controlled.

As well as add, subtract, multiply and divide, you must also include as a minimum, buttons for square root and percentage.

You may add other functions like a memory button or scientific options should you wish.

Closing date: Monday 12 February 2007 at midnight GMT.

TDK_Man

Darkhorse 186
17
Years of Service
User Offline
Joined: 2nd Sep 2006
Location: Scotland
Posted: 7th Feb 2007 19:59 Edited at: 8th Feb 2007 21:32
Hi
here's mine so far. there's something wrong with the sync and it doesn't do anything so far but i'm still working on it.

NanoGamez guy
17
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 8th Feb 2007 19:44
dose anybody know how to get a real number from a sring?

I can see you...
NanoGamez guy
17
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 8th Feb 2007 19:51
This is mine so far...
The 'getvalueloop' function dosn't work and I can't use a decimal point, but other then that, it's OK!



I can see you...
NanoGamez guy
17
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 8th Feb 2007 20:25
I've fixed a few patches but I still can't get a decimal point.



I can see you...
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 8th Feb 2007 22:03
Quote: "dose anybody know how to get a real number from a sring?"




TDK_Man

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Feb 2007 12:00
@ Darkhorse 186:

For the sync, try taking SYNC ON : SYNC RATE 0 out of the do loop
and put it at the top of your program before the main loop.

And just in case you may have had any trouble with clicking the mouse and it repeating an entry a thousand times, there's a trick that can help with that. Take a look at this snippet. When you click on the mouse it will keep repeating hello world until you let go:



Sometimes this is ok, but often, one only wants to register a single click for an entry. Here's an adjusted version that will only print Hello World once for each click and release:



Enjoy your day.
Darkhorse 186
17
Years of Service
User Offline
Joined: 2nd Sep 2006
Location: Scotland
Posted: 9th Feb 2007 17:25
Thanks Latch

Darkhorse
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 11th Feb 2007 04:45
Come on guys - I expected a few more entries for this one!

If you've not entered, you've still got chance - this one ends at midnight GMT tonight.

TDK_Man

Duke Blue Devils
18
Years of Service
User Offline
Joined: 11th Mar 2006
Location:
Posted: 11th Feb 2007 06:12
Hi just saw this challenge 10 minutes ago. Didn't have enough time to follow requirements, but I just felt like posting something.




Visit the official Chicago Rush website
http://chicagorush.servegame.com/index.php
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 11th Feb 2007 12:33 Edited at: 11th Feb 2007 12:36
I'll post an entry too...

You can move the calculator by dragging on the display. sr stands for Square Root.
If you don't like the color, you can change the rgb values in the first 10 lines.



I think I wrote a DBC calculator before. But I'll have to search it in my Database...

[edit] I found it:


It should be a year old or so... I think TDK should remember

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 11th Feb 2007 22:22
Quote: "Closing date: Monday 12 February 2007 at midnight GMT.

If you've not entered, you've still got chance - this one ends at midnight GMT tonight.
"


That's tomorrow isn't it? Or is it 00:00 Monday which I interpret as midnight Sunday?

Enjoy your day.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 11th Feb 2007 23:18
Here's an update of NanoGamez guy's code. I corrected the math functions to use a decimal point - the return values just had to be changed to a floating point number instead of an integer, but without going through the code with a fine toothed comb, I can't get the decimal point to work on the calculator.



Enjoy your day.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 12th Feb 2007 00:02
Latch:

Oops - you are absolutely right! I got my days mixed up and the challenge does indeed end tomorrow night at midnight GMT.

So you all have another 24 hours to finish/enter!

As an aside, I'm thinking of 'un-stickying' this thread. I'm beginning to think that it's being ignored by a lot of users because they can't be bothered reading stickies. Shame on them!

TDK_Man

Lucifer
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 12th Feb 2007 00:32
awww, keep it stickied, it's boring that i need to find it when i want to check the progress.


i like pancakes..
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 12th Feb 2007 00:39
Lucifer

It shouldn't be difficult to find - it will be the red folder post just below the stickies that few of us bother reading!!

TDK_Man

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 12th Feb 2007 07:18
Maybe after a few more challenges it'll pick up more ppl.

Lukas W
20
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 12th Feb 2007 21:26
sorry about not entering. Actually I did enter but because I only have/had time to work on this at work and because I've had a bit more work to do during the last couple of days mine is only half finished.

I may finish it up tomorrow and post but not promising naything.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Feb 2007 03:28
Sorry for the delay - got too involved in a project...

Anyway, this challenge is over. Checking the entries now. Back shortly with the winner...

TDK_Man

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Feb 2007 04:16 Edited at: 13th Feb 2007 04:18
OK - a close thing, but we have a winner.

Darkhorse 186:

Not a bad first attempt. No actual buttons drawn but the button text lit up when you moved the mouse over them. Nice effect and would have been cool with really big text as the buttons.

Fully mouse controlled, but unfortunately the = button didn't seem to work so I couldn't test it.

NanoGamez guy:

Good presentation. Fully mouse controlled and lots of extra functions, but the lack of a decimal point key meant it only worked with integers.

Duke Blue Devils:

Not counted as it wasn't mouse-driven as per the challenge. Very last minute entry, so probably wasn't considered a contender by the author anyway.

Sven B:

Good presentation - I like the ability to drag it around tha desktop. Fully mouse controlled and conformed to the challenge requirements. Worked with integers and decimals, but I more often than not couldn't add two decimal numbers together like 1.2+1.2.


Result:

Runner Up:


Winner:


Over to the winner to set the next challenge...

TDK_Man

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Feb 2007 04:52
Ooo, its over already? whoops.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Feb 2007 23:57
Sven... Where are you?...

We need the next challenge!

NanoGamez guy:

If he doesn't appear in the next few hours, it's up to you to set one.

TDK_Man

NanoGamez guy
17
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 14th Feb 2007 10:46
looks like I'll be setting the next challenge.

I can see you...
NanoGamez guy
17
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 14th Feb 2007 11:35
OK here it is:
___________________________________________________________________

3D Text Challenge

Specification

Put some text into 3D space (as a 3D object) and show that it is 3D (e.g. rotate it). You can add anything else to it to make it look nice if you want.

Deadline

Sunday Midnight GMT
___________________________________________________________________

Does that sound like a reasonable challange?

I can see you...
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 14th Feb 2007 15:56
Sounds ok to me.

Which Sunday is the deadline?

Enjoy your day.
NanoGamez guy
17
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 14th Feb 2007 16:22
18th?

I can see you...
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 14th Feb 2007 17:16
Hmmm...

This challenge might require a little clarification as it can be taken as meaning two things - Text In 3D or 3D Text (as in each letter is a 3D object). Unless either are acceptable?

The first is very easy and the other very hard...

The easy way:



TDK_Man

Lukas W
20
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 14th Feb 2007 17:16 Edited at: 14th Feb 2007 17:26
mine isn't near finished but ahwell. might as well just put it here in case I won't be able to work on it any further_

edit, after reading TDK's comment, I might as well put:

"The harder way:"



edit2:

I don't what got into me when I decided the bug was too hard to fix. This version is the finished product. now working how it should. (only letters though, I'm too lazy to start writing 1's and 0's again :/).



NanoGamez guy
17
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 14th Feb 2007 17:31 Edited at: 14th Feb 2007 20:42
@ TDK man (and everybody else)

You can use either, but the harder option would probably get higher marks

@ Lukas W

Very good, although the text does appear upside down. With a bit of modification, it'll be very good.

(edit) Bug is fixed! well done!

I can see you...
Lukas W
20
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 14th Feb 2007 17:32 Edited at: 14th Feb 2007 17:34
huh? surely you must mean my first version? as I edited my post to upload the newer version that fixed that bug.

or maybe I uploaded wrong code *goes to check*

edit,
unless I'm upside down with a chair sticking out of my eye (..oh wait!) then I'm v. certain that my newest submission fixed the bug

thankx for the comment by the way.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 14th Feb 2007 17:41
OK, just returned and read the reply to my post.

So, here's the second (and last) modification of the 'easy way' before I do it the hard way!

Use the cursor up and down key to alter the camera height...



TDK_Man

Login to post a reply

Server time is: 2024-04-25 07:17:28
Your offset time is: 2024-04-25 07:17:28