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
pictionaryjr
16
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 19th Mar 2009 04:39
So i guess it's only me and u that one smart guy
pictionaryjr
16
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 24th Mar 2009 00:26 Edited at: 27th Mar 2009 04:29
Here is mine so far. Not finished and very bugged.
Posted this even tho this thread is about to die.

BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 25th Mar 2009 12:03
Woah, would have caught you on this one sooner, but you are still on probation.

Please use the code tags, it makes it MUCH easier to deal with so that there isn't a huge page of code.

I forgot about this one, did we ever set a deadline?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 25th Mar 2009 16:17
lets go 3 weeks from today, wenever that is exactly
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 25th Mar 2009 21:36
Sure sounds good, I will see what I can cook up. Lately I have lost all motivation to program so hopefully this will re-kindle the fire.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
pictionaryjr
16
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 26th Mar 2009 02:45 Edited at: 27th Mar 2009 05:20
Fixed
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 27th Mar 2009 00:53
Two ways:

1. Write your code, then highlight it, then click the code button.

2. Click the code button. Insert/write your code. Click the code button.

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
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Mar 2009 16:00 Edited at: 27th Mar 2009 16:01
OK I'm entering this one.
How long do I have left?

The Universe has been erased by a mod because it was larger
than 240x80 pixels.
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 27th Mar 2009 16:27
not quite 3 weeks, plenty o' time
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Mar 2009 23:17
Had a free domain registration with my account and only another week to use it, so I purchased: http://dbchallenge.com/
Might take a day or two before its active, but will take you to the same old http://dbcc.zimnox.com

[url="http://dbcc.zimnox.com"][/url]
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 31st Mar 2009 04:11
If you update it, make sure you show me as tied with Obese for fifth place.


Time is money. I just ripped you off.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 31st Mar 2009 04:22 Edited at: 31st Mar 2009 04:28
@Phaelax
could you change the syntax highlighting colour of the brackets? they are really hard to make out.
Great resource by the way, its cool to look at everyone's old programs without the clutter of the forum

@pictionaryjr
That is a serious amount of code!
did you write out if statements for each individual possible hand?
I can't test it on here but I admire you determination even if it could have been with less code.

can't read?
pictionaryjr
16
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 1st Apr 2009 04:59
@OBese87
haha i know lol. I couldn't think of an easier way to do it, I thought about it for a while but then just gave up and decided to go with a whole bunch of IF statements.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Apr 2009 02:05
when does this end?

Enjoy your day.
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 9th Apr 2009 03:29
dont think we eve decided an exact date, lets go til the 20th

i cant guarantee ill get mine in ontime but ill try

There are only 10 kinds of people in the world, those who understand binary and those who dont
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 9th Apr 2009 03:57
ne objections to me posting one smaller game soon just to ensure i at least enter the contest, then if i get my full game done, posting that as my new entry?

There are only 10 kinds of people in the world, those who understand binary and those who dont
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 9th Apr 2009 04:36
@smartguy
yep we've always allowed multiple entries, you can only win once though

can't read?
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 9th Apr 2009 08:27
Whats the current challenge????

New Site! Check it out \/
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 9th Apr 2009 17:59
best card game

ends the 20th

There are only 10 kinds of people in the world, those who understand binary and those who dont
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 9th Apr 2009 21:55
oh sweet. what are the requirments for the dbc chalanges i have never entered lol

New Site! Check it out \/
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 9th Apr 2009 23:02
the rules are on the first page. main ones though:
1.do the challenge
2.it must not use any outside media.
3.it must be compilable in dbc unupgraded version. so no advanced commands

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 9th Apr 2009 23:49
tnx 4 posting those rules, my poker game uses tons of media and i didnt realize that u cant use external media

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 10th Apr 2009 00:27
Yeah, no external media, but you CAN have it generated in the program (so you aren't just stuck with colors).

Whats cool is that there are ascii characters for the different suits, so you can use text to make the cards.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 10th Apr 2009 06:24
cool, mind giving me a quick crash course on ascii, the only thing i know about it is that it somehow relates to text

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 10th Apr 2009 09:41
Here, a program I made to show the different values for the characters.



Basically you use chr$() and a number that corresponds to the ASCII value for the character you want, which you can use the program to find.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 10th Apr 2009 12:58
Quote: "Yeah, no external media, but you CAN have it generated in the program (so you aren't just stuck with colors)."


As long as you don't convert the images to DATA statements. That has been forbidden because it is just like loading the image...

TheComet

Peachy, and the Chaos of the Gems

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 10th Apr 2009 16:24
Quote: "cool, mind giving me a quick crash course on ascii, the only thing i know about it is that it somehow relates to text"


The application posted above by BN2 Productions should be helpful, but I think you'd be best served hitting google and wikipedia on the matter.

ASCII stands for a standard character translation for single bytes to characters and was devised by the American National Standards Institute or something. Basically, WAY back when TTY was the thing - most datastreams were 8 bit (not all - 7bit was common too). The standard just is a mapping of many values from that value range: 0-127 to characters we recognize. (0-127 = 7bits can cover this range) 8bits range is 0-255.

It's been around as long as I remember, though its important to know what it is.

I'd do some reading on the matter, and while your at it - cosider reading about UTF-8 encoding versus UNICODE - and how UNICODE works. I know it doesn't all apply to DarkBasic TODAY - but it wouldn't surprise me one bit if it did in the future. Additionally, its good stuff to know for your general programming/computer knowledge I believe.

--Jason

That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 10th Apr 2009 16:45
cool, btw bn2, wat r all those boxes in the chart?

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 10th Apr 2009 19:57
the boxes are (i believe) unsupported characters.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 10th Apr 2009 20:22
meaning..... u gotta remember i no nothing about ascii, well very little neway

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 10th Apr 2009 21:41
the box is just a generic placeholder character. it is nothing to worry about. if you use it it will just display a box

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 10th Apr 2009 22:20
And a quick narrowing of the suits(using char set 2).

set text font "arial",2
for n=167 to 170
print chr$(n);
next n

Enjoy your day.
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 10th Apr 2009 22:51
Oh, right, I forgot in my program to set char to 2, I don't think suits are in the standard set, it has to be in set 2.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 10th Apr 2009 23:06
i didnt see the suits in the second set either, ne ideas why?

There are only 10 kinds of people in the world, those who understand binary and those who dont
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 11th Apr 2009 02:09
after a quick google search, ive found some interesitng stuff, apparently other people have said that ascii characters 167-170 are in fact the suits in some programs, but others show them as those box placeholders we talked about

There are only 10 kinds of people in the world, those who understand binary and those who dont
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 11th Apr 2009 02:37
sorry for triple post, do the rules allow you to use data command to make simple images in-program?

There are only 10 kinds of people in the world, those who understand binary and those who dont
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 11th Apr 2009 02:43
Actually, 3-6, but it doesn't work in text editors. (or Dark Basic)

You can try yourself:

Hold alt and (on your numpad) type in the number 003 and release alt. This is what you can use to fudge out other ascii values. i.e. 227 is pi.

That's what they WANT you to think...
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 11th Apr 2009 02:54
So running this code only produces boxes? You don't see the card suit characters?



Quote: "do the rules allow you to use data command to make simple images in-program?"

There's no law against using data statements. The questionable use is where complex images that were photographs or made in photoshop type programs, or complex textures not programatically generated are just converted into data statements as color values and then just dotted to the screen. In the spirit of the challenges, this is similar to just loading in media.

Using data statements is fine, just don't get carried away with the idea of converting a sound file to data, saving it to disk, and then loading it back in. May as well have just loaded the sound file from the beginning (but that's not allowed). The point of the challenges is to challenge one's coding ability. If you need to create some graphics with data statements, that's ok - just as long as it's not just a reiteration of a media file. If you can programatically create a sound file or a 3d model or some great images, that's fine - in fact it's encouraged.

Enjoy your day.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 11th Apr 2009 03:01
Quote: "BEST GAMBLING/CARD GAME"


Any kind of gambling game or card game? Like dice? Or go fish?

Enjoy your day.
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 11th Apr 2009 05:13
sure, why not, although the judging could get confusing comparing dice to poker

the reason i wanted the data images was to recreate a small suit (16x16 or 32x32) image if we cant get the ascii suits to work, is that allowed or not?

There are only 10 kinds of people in the world, those who understand binary and those who dont
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 11th Apr 2009 05:32 Edited at: 11th Apr 2009 05:36
I wrote a little ascii chart program and the suits don't display for any standard fonts, in fact 0-31 don't display. but for those of you with same problem I have good news, I did a bit of poking about and the "symbol" font has the suits at 167-170.

@Smartguy (read this)

can't read?
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 15th Apr 2009 03:12
Just to tell you, I did check out the ASCII suits (with my handy buddy C), and they are 3-6:



*hopes image works*

That's what they WANT you to think...
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 15th Apr 2009 04:01
Sweet! Never thought of using c++ to do it lol

New Site! Check it out \/
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th Apr 2009 04:21
I never really thought of using "hidden" ascii symbols in programs but there's some really useful things especially in "symbol" font; files and folders and all sorts of mini images.
Anyway, back to cards! I have a nice looking felt at the moment and that's about it
Can we use memblocks? I used one for my felt just to practice using the commands.

can't read?
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 15th Apr 2009 05:37 Edited at: 15th Apr 2009 05:48
u sure its "symbol" font, cuz 3-6 on that show up as box placeholders 4 me

edit:
actually theyre 167-170 like obese said, i got it to work, tnx 4 all the input on this tho

There are only 10 kinds of people in the world, those who understand binary and those who dont
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 15th Apr 2009 17:24
do they very from computer to computer?

New Site! Check it out \/
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 15th Apr 2009 17:59
idk, but "Symbol" (dont know if the S makes a difference) font characters 167-170 are the suits for me

There are only 10 kinds of people in the world, those who understand binary and those who dont
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th Apr 2009 18:21
It says in my manual that characters 0 to 32 don't display in DB so I'm surprised if 3-6 works for some people.

can't read?
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 15th Apr 2009 23:00
he didnt say they work in DB, he said they work in C, not sure if that makes a diff but im just sayin

There are only 10 kinds of people in the world, those who understand binary and those who dont
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 16th Apr 2009 23:31 Edited at: 17th Apr 2009 20:25
Well, here is a gambling game I programmed last night... Enjoy!

Controls:

You have to flip all of the numbers to win.

Move the mouse to roll the dice.

click the mouse to let go of the dice.

Click on the number one of the dice show, or on the number that equals the sum of both dice.

Right-click to hide instruction tab.

EDIT : The code is messed up, I recommend you download the attached dba file

code:



Screenshot:



TheComet

Peachy, and the Chaos of the Gems

Attachments

Login to view attachments

Login to post a reply

Server time is: 2025-05-17 11:02:43
Your offset time is: 2025-05-17 11:02:43