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
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st Dec 2010 02:52
Mine shouldn't take people too long, a few minutes for the experienced, maybe an hour for the rest.

"Only the educated are free" ~Epictetus
"Imagination is more important than knowledge..." ~Einstein
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 1st Dec 2010 07:31
Couldn't resist a quick go at yours, Phaelax:




Latest progress: Fog of War implemented; frustrated by pathfinding >.>
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st Dec 2010 20:43 Edited at: 1st Dec 2010 20:47
That's an interesting way to detect a palindrome, but it could be more efficient than using recursion and reassigning new strings all the time.



But your code did get the right answer.

"Only the educated are free" ~Epictetus
"Imagination is more important than knowledge..." ~Einstein
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 2nd Dec 2010 02:06
Cool. Yeah, I imagined there was probably a better way but I had just come back from my CS lecture in which we learned about recursion, so I had it on my mind .


Latest progress: Fog of War implemented; frustrated by pathfinding >.>
Aurum Knight
16
Years of Service
User Offline
Joined: 15th Jul 2008
Location: the suburbs of nowhere
Posted: 22nd Dec 2010 18:51
Is there going to be a Christmas challenge?
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 8th Jan 2011 19:45 Edited at: 8th Jan 2011 19:46
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 11th Jan 2011 14:32 Edited at: 11th Jan 2011 14:36
What about a pool game?


I'm not a grumpy grandpa

Attachments

Login to view attachments
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 11th Jan 2011 20:02
It's been done, February 27 2005. And it kinda turned into a joint community challenge due to the physics being more complex than we all initially thought.
http://dbcodecorner.com/index.php?page=view&challenge=Billiards%20Collision

"Only the educated are free" ~Epictetus
"Imagination is more important than knowledge..." ~Einstein
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 11th Jan 2011 20:22 Edited at: 11th Jan 2011 20:27
It doesn´t need to be exact. Thanks anyway for direction

I'm not a grumpy grandpa
enderleit
17
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 15th Feb 2011 12:18 Edited at: 15th Feb 2011 12:22
Could try to make a texture editor/generator where it doesn't save the final image, but instead saves the steps to make the texture so that it can be recreated when starting your game and saves alot of space...

An example:
1. Create a primitive shape like a box.
2. Add highlighs using simple boxes. (like white edges)
3. Scale down and copy so you have 4 boxes (kinda like tiles)
4. Add some noise.
5. Blur
6. Save the steps used to make the image...

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 15th Feb 2011 20:49
You'll have to store the seed for any random events, couldn't simply use randomize timer(). And, I'm not sure here, but would using the same seed keep the same random numbers on different machines?

"Only the educated are free" ~Epictetus
"Imagination is more important than knowledge..." ~Einstein
enderleit
17
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 15th Feb 2011 21:52 Edited at: 16th Feb 2011 00:32
Don't really need the seed... The primites used for the starting point would be hand-made... and the noise doesn't really need to be the same every time...

I made a "small" example...


The generation seems a bit slow, but that's just because I added sync + delay in between the operators so you can see what it's doing...

candy
13
Years of Service
User Offline
Joined: 16th Feb 2011
Location: mycosplayclub.com
Posted: 16th Feb 2011 10:12
Thanks for putting up the challenge thread - nicely done!

I wanna hold you, till the fears in me subsides..
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 13th Apr 2011 01:18
hey, i was thinking , how about writing a program that solves substitution ciphers?
http://en.wikipedia.org/wiki/Substitution_cipher

that would take some thinking, and programming.

Jimmy
21
Years of Service
User Offline
Joined: 20th Aug 2003
Location: Back in the USA
Posted: 13th Apr 2011 01:54
That would be interesting, but not really something I'd want to use DBP for, personally. At least, not with the solution I have in mind.

We definitely do need to revive this thread, tho! If people like your idea we should give it a go, but I'm going to be thinking of other stuff we can do.

For starters, I was thinking a challenge could be to write a simple script interpreter. Maybe see who can come up with the best scripting system to navigate through a maze, so it involves a little string parsing and a little AI.

NaGaFailMo.
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 13th Apr 2011 03:05 Edited at: 13th Apr 2011 03:07
NaGaFailMo is very funny.

i don't immediately see what a scripting system has to do with navigating a maze,
unless the text file (scripts) are the actual steps thru the maze,
like NNEESEE (north, east, etc) .
is that what you mean?

a scripting system is a good choice generally though.

Jimmy
21
Years of Service
User Offline
Joined: 20th Aug 2003
Location: Back in the USA
Posted: 13th Apr 2011 03:21
I guess I was thinking more along the lines of using a script to accomplish a task, or to bring an object to life. It can be applied to any object, using your own movement and rotation commands. And for the purpose of the maze, it could maybe check for collision or scan ahead for obstacles. Other applications could be moving platforms or triggers to open doors and whatnot.

NaGaFailMo.
melissa2
13
Years of Service
User Offline
Joined: 4th May 2011
Location:
Posted: 4th May 2011 16:23
Who has won the competition?

[url="http://www.unlockconsole.com"]Unlock Wii[/url]

Homebrew coder/maker
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 5th May 2011 22:04
an official challenge has not been declared in months, so no winner.
if you have an idea, or want to work on one of these, go ahead!

A r e n a s
16
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 21st May 2011 21:41 Edited at: 21st May 2011 21:44
I had a very quick go just to generate these magic three digit numbers Heres the code I created and it seems to have worked fine;



EDIT

I thought it was three now two three digit numbers, whoops Thought the code is easily changeable

Penfold
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 24th May 2011 21:14
I have an idea for a new challenge, it may have been done before but even if it has why not do it again with a new wave of coders.

*Looney Lander*

All the objective is is to make some form of lander style mini game.

This could be as simple as a falling block and pressing the space bar to use fuel so that it doesnt explode because its coming down too fast. Or as advanced as random asteroids (spheres) that you can try to land on as you pass.

Marking could be based on concept and finished working mini game.

*do a search on lander style games and you'll get what I mean*

I think this would be a fun and smallish project even for those with little or no knowledge in DB to get there teeth into and someething that could be blown up to something really nice for those more experienced coders.

Let me know what you think * and a mod to judge would be nice too*

'Ooh 'eck chief'...'crumbs'
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 26th May 2011 17:03
sounds like a good idea to me, but since this thread is pretty informal,
the person who sets the challenge is the judge. so that would be you, penfold!

i'd recommend we go with this for about 10 days, it's the best idea we've had in months i think...

chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 26th May 2011 23:18
It is a pity this thread disappears...occasionally, some friends come with a brilliant idea, but the low participation, bored everyone that try to save the thread.


Cheers.

I'm not a grumpy grandpa
Penfold
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 26th May 2011 23:38
well lets go for it then shouldnt be too difficult.

We'll end it Sunday the fifth / Monday the Sixth as its ratehr informal and I'll take a look on the 7th at entrys.

Are there winner badge / Icons for programming like the 3d ones?

SO lets get started then, If we aim for 10 entrys that would be quite good so if everyone who reads at least has a stab at it. (an hours worth of work should give you something even as a completely new coder). And if we can advertise it to other peeps on here that may not have read this post that would be good too.

'Ooh 'eck chief'...'crumbs'
Non Sequitur M
16
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 27th May 2011 19:11 Edited at: 28th May 2011 01:33
Count me in. I need a break from my current project to test other aspects of DBP.

It's gonna have lasers, and army men, and big splosions, and thins goin 'arrrrrrgh!'

No, seriously, sounds neat. I'm in.

Arbrakan
14
Years of Service
User Offline
Joined: 10th Oct 2010
Location: Geneva
Posted: 27th May 2011 22:14
Great idea, A little break on my head project, i play with you ! it's gonna be legendary !
Non Sequitur M
16
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 27th May 2011 22:50 Edited at: 28th May 2011 01:39
Sorry for the double post. Had to show my new sig. I took the liberty, and created it. So, we can rep it all over the forums. Anyway, here's the code:


It's the same one that's in my sig.

[EDIT] If you hit edit post on one of your posts, and then hit edit message, it will change your sig, but not the message. That way, you can go to a few of your posts and add this sig to current topics! Don't know if that's against the rules, but you ARE editing your message. Haha.

Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 28th May 2011 12:11 Edited at: 28th May 2011 12:30
Here's my entry.
This is my first time entering this competition.
I'm not sure if you post the source code straight away so I've left it out and can post it later.

fun project, thank you for the challenge.

edit: after looking through the thread I can see that others post their source instead of exe so here's my source, It's a little messy but I'm working on getting my code more organized with every project.
Kezzla



Sometimes I like to use words out of contents

Attachments

Login to view attachments
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 29th May 2011 22:21
Kezzla - your code doesn't run on my DBPro. I think it doesn't like the colon on the gosub labels, so



should be



but even when I take all the colons out, it still throws the error. Does your code run on your machine? What DBPro version?

Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 30th May 2011 01:09
hmmm, I have dbpro 7.7 rc 7 on windows xp sp3

so there may be an issue there with the beta update, however I've used code that has always worked for me with previous db pro versions.


this code runs on my machine. and the colons don't effect my code(though from now on I'll leave them out - was a hangover from misreading a tutorial)

I wonder what the problem is, My DBPro beginners challenge exe wouldn't run on others computers either even though it runs on mine.

what version of db pro is yours?

Sometimes I like to use words out of contents
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 30th May 2011 05:30 Edited at: 30th May 2011 11:00
LOL!

It wasn't the gosub labels, it was the underscores on the comment lines. My editor uses underscore for line continuation. Once I took those out, it compiles okay, except that my computer doesn't support the screen resolution you used. And when I change it to my desktop resolution, some of your text gets cut off. But at least it compiles.

It took me about 5 tries to land one without killing anything.

Nice work.

Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 31st May 2011 07:47
Cool. Ill add some code to re-size the text for different resolutions.

in future Ill also remove underscores before submitting public code to eliminate hassle. what editor do you use?

Thanks for giving it a go.
Kezzla

Sometimes I like to use words out of contents
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 31st May 2011 10:37
I'm using "EditorNew" which is the June 23rd, 2010 build of Synergy. This editor has an options setting that lets the user decide if the underscore character is used to continue lines.

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 31st May 2011 11:04
Kezzla, nice idea of going 3D but I couldn't seem to ever land on that square. I was always in front or behind it.

Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 31st May 2011 11:59
yeah?
that's strange as the collision detection is pretty liberal, so long as the cone is touching the square somewhere it will register.

do you get the "you need to land on the square" message?
that message will mean a miss, but the other red messages mean too hard a landing.

The landing has to be super soft or it will crash even if over the square,

I originally thought it may have been a little too strict but after getting used to it I figured it was good to have to be so gentle on the touchdown.

to make it less sensitive, up the values on these lines.



Sometimes I like to use words out of contents
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 31st May 2011 12:45 Edited at: 31st May 2011 13:36
I don't recall a message(but it could be there), but I go right passed the square into the ground below... then I die.


So I had a go at this challenge since I haven't done one in I don't know how long and it sounded fun. There was a similar challenge about 5 years ago: http://dbcodecorner.com/index.php?page=view&challenge=Lunar%20Lander. It looks like people took the 3D approach, whereas I'm going 2D with this one.

Collision isn't there yet, but here's my 2 hours worth of work.


Edit: I added some collision. I also got an idea for an extra twist to the game.

Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 31st May 2011 12:59
Meh.

For some reason (probably my editor settings again), when I cut and paste your code (Phaelax) it comes out in one long line and generally messed up.

So, I copied your code, pasted it into MS Word, saved it as a text file, THEN copied the text file into DBPro. That worked.

Anyway, LOOKING GOOD! I like the retro-looking vector graphics!

For my entry, I'm using 2D graphics mapped onto planes. So, a combination of 2D and 3D, I guess.

IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 31st May 2011 20:57
Phaelax , yours looks great, totally retro. functions great too.

here's mine. it's messy, but that's how it turns out when i code fast.
arrowkeys to thrust.
you get 10 chances to land 10 ships (?!),
the smaller the landing pad, the higher your score.
crashing a ship cuts your score by 2/3
there is wind as well as gravity.



Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 31st May 2011 22:14
I can't get yours to work IBOL. I get a frozen black screen.

Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 1st Jun 2011 04:12 Edited at: 1st Jun 2011 04:13
IBOL, your code locks up my computer as well. I tracked it down to these lines...



around lines 155 to 160. Commenting out the "dot t,u" enables the game to run. Seems very hard to land though. I only average about one safe landing out of ten.

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st Jun 2011 05:42
Nice catch Rich. If I change DOT to BOX instead, it'll run.

The gravity is way too strong. Even multiplying the thrust by 2 I still could barely catch the ship before it shot straight down into the mountain. And at one point, the wind was too strong to overcome and so I was always moving left.

Still, a great start, just needs fine-tuning.

Let the game begin
13
Years of Service
User Offline
Joined: 31st May 2011
Location: India
Posted: 1st Jun 2011 07:54
Interesting....

I ran the game and it sounds great. The reason is no use of external images. I will try my best to catch it up as soon as possible. And may be I optimize is even more.

Now I'm gonna read the challenge from the scratch so that I could understand the topic.

This is TDM (i.e. The Dark Man).
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st Jun 2011 11:06
Here's my current version, more to come soon!



Jimmy
21
Years of Service
User Offline
Joined: 20th Aug 2003
Location: Back in the USA
Posted: 1st Jun 2011 16:08
Look pretty good, Phaelax! Now I have to enter this challenge...


May 10th / Jerico2day-OBese87 / VOTE NOW
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 1st Jun 2011 16:37
hmmm, phaelax, I get an error compiling your code.

Cannot find structure 'drawTerrain:&max' in local declaration at line 401.
PROGRAM TRACE

I have DBPro 7.7 cs 7 on my machine.

your first 2 hours code worked fine and was pretty cool.

kezzla

Sometimes I like to use words out of contents
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 1st Jun 2011 17:38
phaelax,
max(
does not appear to be defined in the program.
(i did a search, and it is used but never defined.)

Jimmy
21
Years of Service
User Offline
Joined: 20th Aug 2003
Location: Back in the USA
Posted: 1st Jun 2011 17:56
Oh, in case anyone is interested, this challenge inspired me to write a complex-polygon drawing system that I stuck in the Code Snippets board over yonder. Of course, shortly after writing it, I realized that it disqualified me from the challenge because I was using Matrix1Util array commands, so I had to convert it to native DBP.

If you decide to check it out, you can see that it has proved to be very useful in drawing my lander


May 10th / Jerico2day-OBese87 / VOTE NOW
Jimmy
21
Years of Service
User Offline
Joined: 20th Aug 2003
Location: Back in the USA
Posted: 1st Jun 2011 20:54 Edited at: 1st Jun 2011 21:20
Pardon the double post. It's way past my bed time and I wanted to show what I have so far.

Controls:

A = left engine
S = center engine
D = right engine

Q = left stabilizer
E = right stabilizer

It controls differently than any lander game I've ever played. Hope you hate it!



Edit:

Adjusted gravity and boost settings. Added stabilizers for ez mode


May 10th / Jerico2day-OBese87 / VOTE NOW
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st Jun 2011 22:21 Edited at: 1st Jun 2011 23:36
max must from a plugin I have then. Just add this function:



BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 1st Jun 2011 22:47 Edited at: 1st Jun 2011 22:48
It's a Matrix1 function.

EDIT: Also, you seem to have a pretty serious typo in that snippet .

Login to post a reply

Server time is: 2024-11-24 05:10:24
Your offset time is: 2024-11-24 05:10:24