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
Tomu
20
Years of Service
User Offline
Joined: 27th Jan 2004
Location: Block C Flat 2 Room 8
Posted: 29th Apr 2005 08:13 Edited at: 29th Apr 2005 08:14
<edi> wrong threAD


Vote "None of the Above" force a re-election!
- 3.4Ghz - 2048MB RAM - RADEON X800SE -
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 29th Apr 2005 08:18 Edited at: 17th Aug 2005 18:20
I guess you (obviously) didn't get my cheque
or see my last update

You know, the one I lost a LOT of sleep trying to get done??

[/Sarcasm]
Oh, did I forget to set the [Sarcasm] start? Heh-heh.


"Droids don't rip your arms off when they lose." -H. Solo
REALITY II

Attachments

Login to view attachments
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 29th Apr 2005 08:52 Edited at: 29th Apr 2005 08:52
Hehe.. Ok, I MUST sleep now, I have to get up for work tomorrow.. Lol..



There is now a POINT to the game!
You have 60 seconds to catchs more targets that the AI can..

Good luck - Its finger lickin' hard!!

If ANYONE knows ANYTHING about the intersect object command being a bitch - its about the only thing left thats wrong and I have NO idea why!! :-P

EDIT: Btw: The AI is harder in this version - it can go 50% faster

My Website:
Tomu
20
Years of Service
User Offline
Joined: 27th Jan 2004
Location: Block C Flat 2 Room 8
Posted: 29th Apr 2005 08:56
lol now now rideeeeee. your game is alos just as impressive in its number of updates!

damn the royal mail for dropping such an imoportant cheque.

(hehe. pockets the cheque and walks away 10p richer)

but im really not sure who to choose this time. only less than 1 day to go! any last entries?

Tomu.


Vote "None of the Above" force a re-election!
- 3.4Ghz - 2048MB RAM - RADEON X800SE -
Tomu
20
Years of Service
User Offline
Joined: 27th Jan 2004
Location: Block C Flat 2 Room 8
Posted: 29th Apr 2005 08:57
ok nicholas just beat you on sheer number of updates r2

Tomu


Vote "None of the Above" force a re-election!
- 3.4Ghz - 2048MB RAM - RADEON X800SE -
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 29th Apr 2005 08:59
Hehe...

My Website:
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 29th Apr 2005 09:11
[IGNORE THIS - enabling post back ]

My Website:
Game pro
20
Years of Service
User Offline
Joined: 21st Mar 2004
Location: Usa
Posted: 29th Apr 2005 10:09
thank you your racing game has good source code i could learn alot from it. Is there anything i need to download for this game to work???

I have nothing to say to the likes of you.
KimoSabi
19
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 29th Apr 2005 13:30 Edited at: 29th Apr 2005 13:31
well i have added 3 powerups

-Force Direction Blockade
-Uranium Wave Bomb
-Time Distortion Unit
and fixed all known bugs(including so you can now actually restart the game)

well here is my last hope update(i have a good idea for my next win)



My Website:

Tomu
20
Years of Service
User Offline
Joined: 27th Jan 2004
Location: Block C Flat 2 Room 8
Posted: 29th Apr 2005 14:41
Still incredibly playable kimo! very nice touch with the powerups (particularly the names ).

there has been so much effort put into this contest and it will close in under 17 hours!

this is going to be a nightmare to judge!

Tomu.


Vote "None of the Above" force a re-election!
- 3.4Ghz - 2048MB RAM - RADEON X800SE -
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 29th Apr 2005 18:33
@Game pro: The whole idea of these challenges is that they're media free. This means all you ever need to do is copy and paste the code into DBP and press F5!

Oh how I wish DBP ran on my work machine.. Well it does run - but at about 3fps :p DAMN these onboard piles of silicon!

My Website:
Tomu
20
Years of Service
User Offline
Joined: 27th Jan 2004
Location: Block C Flat 2 Room 8
Posted: 30th Apr 2005 09:16
Hi All after much delibiration and stuff i managed to make some sort of decision: ALL entries were amazing and the winning margin was literally non existant!

So here it is the grand winner of the Space race Challenge:

Winner:


Runner up:


Special Mention:


Well done winner! Now you can make a funky challenge

This has been an incredibly difficult choice and ALL games were so close that i re wrote this post 3 times!!!

Tomu.


Vote "None of the Above" force a re-election!
- 3.4Ghz - 2048MB RAM - RADEON X800SE -
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 30th Apr 2005 09:32
Congratulations Nicholas! Well deserved. And Kimosabe! Thanks Tomu for the great challenge!

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
KimoSabi
19
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 30th Apr 2005 09:36
well didn't win but got runner up and i may add a suggestion nicholas:

A puzzle challenge something with puzzles of some sort

My Website:

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 30th Apr 2005 10:58
cool nicholas, although I felt like i was playing days of thunder on NES. The AI had perfect control, even around planets.

PETA - People for the Eating of Tasty Animals
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 30th Apr 2005 11:32


AT LAST!!! Hehe.. It only took 900+ threads but I've done it

Hmm Puzzle theme.. Not a bad idea at all!!

I'm not gonna set the new one now as I've had a fair amount to drink To be honest, I was thinking something along the lines of a clock screensaver - but the puzzle idea has me thinking.

I'm gonna sleep and let you know tomorrow.

Thanks all - it really is appreciated

On a slightly different note.. I am currently working on ThingyMaJig V2.. Its gonna be more dynamic and its gonna include more techniques I've learned from my new job. I'm thinking a good features might be to include the winners from each compo.. Seeing as each compo is Source only (no media or anything), it would be a simple task of storing each entry with each challange.. What do people think? Ideas for features for the ChallengeDB would be appreciated...

My Website:
Coding Fodder
21
Years of Service
User Offline
Joined: 25th Sep 2003
Location: Somewhere in my cerebralcortex
Posted: 30th Apr 2005 16:21
Challenge data base!! Cool!! I would suggest some search options so people could look for sample code, maybe just keywords. Also it would rock if the winner could update his/her entry to clean up or comment the code in the future.

Something really catchy that makes people stop and think about the meaning of life and say to themselves "My but thats clever"
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 30th Apr 2005 20:26
Congratulations Nick

Sorry all that I didn't get around to entering this one - it was a good challenge, but I hardly had a minute this week to sit down at my PC.

Good idea about the database, too. If/when it gets done, I'll add a link to it from the first post in this thread.

Looking forward to the next challenge.

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 30th Apr 2005 22:28 Edited at: 30th Apr 2005 22:30
I'm glad the Database is considered a good idea - I've thought of a cool name for it: DB-Challange-DB

As for the challenge.. I've had an idea - but I'm not 100% sure yet.

I was thinking of going back to the roots of the challenge and setting a task that will produce some very usefull and reuseable code.. However, my idea could be considered quite hard for some, but it would certainly be a VERY good learning process.. In fact, to hell with it.. This is the challenge peeps..

THE CHALLENGE

Encryption/Compression


Basically, This challenge is testing the programmers ability to take data, modify it and output it.


The REAL challenge is being able to take the data both ways. Its one thing to make data unreadable by anyone but a PC, but its another kettle of fish to make it a two-way process!

The reason I have done encryption/compression is it gives scope for different algorithms to be produced.

Marks awarded for:
Code Efficiency. This means speed/technique, etc
Security (if encryption). How hard is it to crack (if at all)?
Compression rate (if compression obviously).
Maybe readability? The point of these challenges is that people can benifit. This is made inifinately easier if the code is indented/remarked/generally well written.

You get a week

What do people think of that idea?

Seeing as I'm not gonna be submitting a serious entry into this one (as I cant win ) I'll start work on DB-Challenge-DB

My Website:
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 1st May 2005 05:36
i think this is an awesome challenge. both compression and encryption
are topics i've been interested in trying my hand at, so now i have
an excuse...thanks nicholas. as for the database, good idea also.

bob

http://astrumgames.com
completed games: Astrum Erus, Centipoid, Hero Of Garaven, WarpFlight, Higher Ground , Circular Breakout
KimoSabi
19
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 1st May 2005 09:56
yes the database sounds great and so does encryption although i posted one earlier i'll think about doing another one and btw what did you think of my game?

My Website:

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 1st May 2005 10:00
Nice challenge idea. It will be interesting to see if this one attracts some different people. I'll have a go at writing a secure text encryption/decryption program.

Tomu
20
Years of Service
User Offline
Joined: 27th Jan 2004
Location: Block C Flat 2 Room 8
Posted: 1st May 2005 12:36 Edited at: 1st May 2005 12:38
heres a quick put together of a simple encryption algorithm.

This isnt my entry as i will spend more time later

just a simple beginning i think

- generates a key
- user inputs a message
- encrypts message
- asks for key
- decrypts message



Tomu.


Vote "None of the Above" force a re-election!
- 3.4Ghz - 2048MB RAM - RADEON X800SE -
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 1st May 2005 13:18
Yay.. I'm glad the challenge has been accepted

I think i'll work on the db idea tomorrow.. Spent today playing Black and White with my mate in LAN mode (thats the game was in LAN mode, not my mate.. ) I never realised how good it was in multiplayer

My Website:
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st May 2005 17:43
so are we suppose to make encryption? or a database? If a database, then can I submit pascal source code? cause mine's already done

PETA - People for the Eating of Tasty Animals
Tomu
20
Years of Service
User Offline
Joined: 27th Jan 2004
Location: Block C Flat 2 Room 8
Posted: 1st May 2005 18:38
its a modification of data challenge not so much of a database challenge i think. i think i might do some image or 3d model compression/encryption..

Tomu.


Vote "None of the Above" force a re-election!
- 3.4Ghz - 2048MB RAM - RADEON X800SE -
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 1st May 2005 21:18
Read the challenge post on the previous page..

Its an encrpytion/compression challenge.

The database is a project I am going to work on for the challenges called DBChallngeDB. It'll be a way to collate all the challenges together and also add a search facility.

If i'm feeling particularly mental, I might work on a PHP->DB Parser

My Website:
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd May 2005 03:32
I looked up Huffman compression. I understand the concept, but I'm not sure how to code such a thing in DB. How can I write bits to a file?

PETA - People for the Eating of Tasty Animals
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 2nd May 2005 04:03 Edited at: 2nd May 2005 04:05
phew - managed to make it before anyone answered Hehe..



Hows that?


EDIT:
Btw: You CAN define numbers like this..


I think..

My Website:
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd May 2005 12:15
but you're still writing bytes to the file

PETA - People for the Eating of Tasty Animals
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 2nd May 2005 12:30
Bytes are made up of 8 bits. Thats how it works..

My Website:
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 3rd May 2005 02:24 Edited at: 3rd May 2005 02:27
There's an exncryption challenge and no-one told me?!! I've already written encryption, it works fine except for wierd characters in files (like those boxes, they convert to what they are meant to appear as )

There's no way in hell I'm going to attempt to add compression to it as I'm lazy, but I'll neaten the code and as of yet no-one has cracked it

"OC192...that's like the speed of light"
KimoSabi
19
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 3rd May 2005 02:45
im working on one right now and trust me no1 will crack it

My Website:

Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 3rd May 2005 02:48 Edited at: 3rd May 2005 03:08
Thats not true, no-one who is not willing to sit at a computer for the rest of their lives can crack it

I've just neatened my code and added comments. It works reasonably well (there are a few bugs but with basic text files you cant go wrong), and it's not that inefficient.

On the subject of compression, I know some basic concepts, but I dont want to get into it, I need to do some school work.

Here it is. I just compiled these as hidden since they don't output any text Everything is in the rar attached.

README.txt


encrypt.exe


decrypt.exe


Key Generation.exe


Example of input.txt


"OC192...that's like the speed of light"

Attachments

Login to view attachments
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd May 2005 03:08
I know a byte is 8 bits, but i need to be able to write possibly at 2-3 bits at a time. The whole point is so you don't have to take up 8bits to represent each character.

PETA - People for the Eating of Tasty Animals
suspender
20
Years of Service
User Offline
Joined: 12th Oct 2004
Location:
Posted: 3rd May 2005 04:13
make a mem block 2-3 times bigger than needed and skip blocks as needed or write them to a numm value, giving opnly ones with meaning some denotation.

dino strong$1!
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 3rd May 2005 05:11
Ok Phaelax - I see the problem now..

Ok, What you need to do is:
1) figure out which bit of which byte you are modifying. This can be done using MOD and divide.. EG:
You're modifying bit 77.
That means you're modifying Byte 77 / 8 = 9.625 = Byte 9.
You're then modifying Bit 77 MOD 8 = 5

2) Now, that means you go to position in your array or memblock that is at byte 9. Then you add 2^5 (as you are enabling bit 5).

Make sense?

My Website:
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd May 2005 10:07
but memblocks still only work in bytes, not bits. how do i write 1 bit? Say i have a memblock of 40 bytes. How could I retrieve and set the value of bit 3 within byte 1? Some sort of bitwise operators I'm guessing, but not sure how to use them other than shifting the current data around

PETA - People for the Eating of Tasty Animals
Tomu
20
Years of Service
User Offline
Joined: 27th Jan 2004
Location: Block C Flat 2 Room 8
Posted: 3rd May 2005 13:50 Edited at: 3rd May 2005 13:53
use bit shifting

look at the code snippet

hope it helps

at the mo only works with bytes (0 - 255) but it would be easy to make it work with bigger data types.

Tomu.





- 3.4Ghz - 2048MB RAM - RADEON X800SE -
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 3rd May 2005 20:45 Edited at: 3rd Mar 2008 10:59
Fyi, With the help of a good friend, I have been working on a PHP -> DBP Parser. It works pretty well so far...

The problem is, I cant get the word wrapping to work - I THINK because each section of a line is classed as "inline" which wont wrap, only BLOCK's wrap.. Anyone got any idea's?

Once its done, I'm gonna make the parser open-source.. In fact, I'll do that tonight Any help with it will gain credits in the comments for it

Currently, it loads a list of commands up and parses them based on that. Its a pretty clever algorithm developed (I tried by got it all wrong and it ended up making 40Mb HTML files )

[center]
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 4th May 2005 02:19
No-one's looked at my entry

"OC192...that's like the speed of light"
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th May 2005 03:15
Ok Neo, I've looked and my first impression is a concern about the secuirty.

If you sent me the encrypted file - how would I decrypt it? With the key of course.. But that means you need to send me the key. THATS my concern - Althought its a good idea to be able to change the key, it does mean that if anyone gets that key, your security is comprimised, especially if its sent seperately...

Apart from that, its neatly done and well commented! Looks like it should do the job well, although I'm not sure abuot why its limited to normal characters.. What if I wanted to encrypt and EXE with it?

My Website:
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 4th May 2005 05:49
I'll explain why it doesn't work properly. With files some of the characters appear like a box. When decypted they get converted to a different symbol or something, although I'm confident the code is the same, it doesn't save it to the file correctly, which has left me baffled (and I'm too lazy to look into it).


As for passing the key around, that's your responsablity using something rememberable like a 64 character phrase, or printing it, giving it to the other person who eats it after use ...basically, you should be using different keys for each thing...an idea would be to make a hypersecure webserver to give you passworded access to a rar file, which in turn is passworded (assuming you've told them the passes) and then get the key from that...


If I have a chance to look into the slight conversion problem I'll do so, but I'm not going to deal with the security of passing the key...and although I understand some theories of compression (like the way PNG compresses (ignoring the backup mechanism)), I have nowhere near enough time to start that


Arf better get back to my homework

"OC192...that's like the speed of light"
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 4th May 2005 10:54 Edited at: 4th May 2005 12:09
Here's my coding entry for this challenge. It's a pretty nifty and very effective compession code. I still need to work out some of the kinks on the decompression, so use with care.



Edit: Comments added per Neofish's suggestion. Also made UI a little more freindly. Thanks for the comments Neofish!
Edit 2: With a little work - I am pretty darn close to 100% compression.

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 4th May 2005 10:56
*sigh*



It isn't commented!

"OC192...that's like the speed of light"
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th May 2005 12:29
r2d2, submissions without a successful decompression don't count!

nice parser nicholas. I started one a few weeks ago myself, but with work and school I dont have time for even these simple challenges anymore.

PETA - People for the Eating of Tasty Animals
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th May 2005 18:15
I know what you mean - its slightly depressing when you realise that between work, eating, sleeping, washing and all the other essential in life, you only tend to get about 30 mins a day to yourself and by then your often too tired to do anything with it!

The site is coming on, its nowhere near ready for "release" yet, but I'm gonna neaten up and comment the parses and release it as open source. This means we can hopefully make it into a really nifty bit of kit as a function that peopel can just drop into their website for their own parsing needs

@Riidii: I'm gonna discount that entry until the decompression algorithm works. Its very importatant that once you compress your data, esepcially by 100%, you get it back. If you can indeed master this compression - you will be a rich man Hehe..

My Website:
KimoSabi
19
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 5th May 2005 02:37
i dont think i'll finish my entry cause i just got WoW and i have been playing it 24/7 btw can't you just use certain C++ commands to store stuff into bits?

My Website:

IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 5th May 2005 07:16 Edited at: 5th May 2005 11:42
ok, so i made some code to encrypt a message.
it also successfully decrypts it.
it has built-in decryption keys, one is chosen at random for each message. it turns plain text into this:


and then back into this:


how are we handling this whole thing?
isn't it counter productive to post the code to your encryption process?

bob

http://astrumgames.com
completed games: Astrum Erus, Centipoid, Hero Of Garaven, WarpFlight, Higher Ground , Circular Breakout
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 5th May 2005 17:39
well, i've spent the rest of the day trying out different compression ideas...and compression is hard.

i tried to parse thru files, finding the most common short strings,
and replace them with shorter things...
what i need is some extreme math and low level programming that is quite beyond me. i got about 10% compression...

anyone getting good compression results in dbp for this?

bob

http://astrumgames.com
completed games: Astrum Erus, Centipoid, Hero Of Garaven, WarpFlight, Higher Ground , Circular Breakout

Login to post a reply

Server time is: 2024-11-22 15:51:45
Your offset time is: 2024-11-22 15:51:45