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.

The 20 Line Challenge / [DBP] "Paint"

Author
Message
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 26th May 2010 18:01
I have made a basic painting program, it's very basick now but i will upgrade it. I have only been programming for about a week



Srry about my english im from sweeden
Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 27th May 2010 04:03
This should probably go in the Newcomers board. According to the sticky at the top of this board:

Quote: ""The object is to show everyone your programming skills by compressing as much programming code as you can into 20 lines or less to produce the most impressive program that you can.

Anyone can write a 'Hello World' program in less than 20 lines and post it on here. No-one does because it's pointless and shows no programming expertise. Your program should make people say "Wow - that's clever! How did they do that"?

Now if you can write a complete game in 20 lines or less (as many posters have already done) then feel free to post - and amaze us all.""


Not to discourage you or anything, but this isn't exactly the type of stuff this board was made for. Also, it would be better if your 'StartOver' subroutine was a goto instead of a gosub, because every time you call it as a gosub it adds the return call to a stack, which can fill up and eventually crash your program because the returns aren't being called and removed from the stack.
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 28th May 2010 08:46 Edited at: 28th May 2010 16:17
Ok, have upgraded the program a bit, i havn't tried to fit it in 20 lines.

You can now save the picks by pressing s, im not sure if it allways works because it worked at firsn but after a whle is stopped working.

You can no crate rings, boxes, and lines by prssing r,b or l.
for boxes First click were you want the box to begin, then press were you want it to end. When the box is painted, prss enter or left mousebutton.

For rings, first klick were you want the center then click hpw far from the center you want the radius.(Click center, then outside)




Compressed


There is something wrong with the 20 line version , probaly some : that's missing.

But the uncompressed works and if you look you can see that it's the same

Srry about my english im from sweeden
t10dimensional
15
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 29th May 2010 20:53 Edited at: 29th May 2010 21:01
Here's an improvement to your code.

Messing around with it will help ya understand it better. Try to keep all your code in this type of style.

Login to post a reply

Server time is: 2024-04-23 23:08:25
Your offset time is: 2024-04-23 23:08:25