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 / Command Based Drawing Program

Author
Message
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 21st May 2003 20:41 Edited at: 21st May 2003 20:51
DBP only. To use this program, it is best to use windowed(800x600). This is quite hard to get the hang of using, but after quarter of an hour I managed to get the frame of a cuboid on the screen. The commands are as follows:
turn (integer)
forward (integer)
colour (integer),(integer),(integer)
pen on
pen off
eraser on

Note that when entering colour(UK English spelling) every number should be 3 characters long eg. colour 000,255,000

To get used to using it try making this example drawing.

This should make a square with 4 different colours.

Edit - Note on directions: 0 is down, 90 is right, 180 is up, 270 is left. The turn command turns x degrees anti-clockise

Don't visit the Mad Matt Games Website
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 21st May 2003 23:18
Now it has a repeat command. You put repeat (integer): at the start of the command and everything will be repeated x times.
Note that inside repeat command all numbers must be 3 characters long eg.010 etc.
Also, the repeat command may sometimes not work properly with more than 6 commands in it, but it should be okay.(i'm not sure if you can use goto inside a for loop)

Try this example program.

This should give a circle with a dotted outline.

Don't visit the Mad Matt Games Website
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 21st May 2003 23:27
I've just realised a better way to do it. Now you can have as many commands on a line as you want(but too many will mean you can't see what you are typing)
Only 8 lines, too.

Don't visit the Mad Matt Games Website
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 21st May 2003 23:42
Discovered a bug. Now it works perfectly(I hope)
anyone with any good effects please reply to this thread. I'm sure there's a way of making a star or something.

Don't visit the Mad Matt Games Website
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 21st May 2003 23:51
Try this for an example of how to do a multicoloured circle.

Inside a repeat command, if you mistype something or type the wrong number of characters, the program is liable to go into an endless loop.

Don't visit the Mad Matt Games Website
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 21st May 2003 23:58 Edited at: 21st May 2003 23:59
Now the text scrolls left so you can always see what you're typing.

Don't visit the Mad Matt Games Website
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 22nd May 2003 00:59
I've worked out how to do the star! Try this for a nice effect.


Don't visit the Mad Matt Games Website
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 23rd May 2003 19:19
could you do a compiled version, for dbc users????

ARE YOU A 3D MODELER??? IF SO WE NEED YOU!!!
EMAIL mynameisnoneofyourbuisness@hotmail.com to work on the new Star Strike project!!!
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 23rd May 2003 20:35 Edited at: 23rd May 2003 20:37
hi guys, thought i'd try my own paint program and here it is
it features
mouse control
2 types of brush(filled circle/square)
variable sized brushes
loading
saving
rgb colour picker
eraser

controls
left mouseclick+move to paint with current brush and colour
right mouse to erase
control-clears the screen
'l'-load bitmap(no extension needed)
's'-save bitmap(no extension needed)
'r'+'e'- r increases red, e decreases red
'g'+'f'- g increases green, f decreases green
'b'+'v'- as above but with blue
'+' increase size of brush
'-' decrease size of brush
'1'+'2' changes between the brush types

it could be put into 20 lines but it isn't because i got errors, grrrr
hope you like it

#edit sorry posted in wrong thread could someone move this to the paint thread, soz

ARE YOU A 3D MODELER??? IF SO WE NEED YOU!!!
EMAIL mynameisnoneofyourbuisness@hotmail.com to work on the new Star Strike project!!!
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 23rd May 2003 21:24 Edited at: 23rd May 2003 21:26
I have decided to take this beyond 20 lines, using Rob K's Windows Menus plugin, to feature loading and saving options so you can edit programs in notepad to make it easier to come up with good ideas. DBP 4.1 has a problem with "Save All" so I lost a lot of my work and just started completely from scratch so it will also feature a new editor that looks a lot better and you will be able to have nested repeats up to 20 repeat commands on one line. One question though, does DB feature recursion i.e. a subroutine calls itself within itself. eg.


You can get that in a lot of Declarative languages but I'm not sure if it works in DB. That would make the nested repeat command a lot easier for me. I have had problems but I'm not sure if that is the problem.

(Edit): Yes I will upload a compiled version once I've finished the next version (hopefully by Monday). It's only 600KB so I can host it on my own website, for once

Don't visit the Mad Matt Games Website
sicjoshsic
20
Years of Service
User Offline
Joined: 8th May 2003
Location: United Kingdom
Posted: 23rd May 2003 22:15
i havn't seen it (i dont have dbp) but this sounds like turtle, that program that you use in primary school...

Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 23rd May 2003 22:25
You mean WinLogo? That's what I based it on. It had a turtle on the screen and you told it to move so many spaces forward etc.

Don't visit the Mad Matt Games Website
Sephnroth
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 24th May 2003 02:37
very good!

and yup, turtle I had turtle on my acorn electron and even have the programming guide for the electron with a chapter on programming turtle, good stuff

p4 2.4ghz, 256ddr ram, Geforce4 MX 440
Innovate, redefine, recreate whats in your mind. It isnt fate, you decide, only you can cross that line.
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 24th May 2003 03:02
With the compiled version(524KB zipped, ready for release once I add the help stuff to it) you don't have to worry about perfect syntax quite as much. Eg if you wanted a dark red colour instead of typing colour 099,000,000 you can now just type colour 99next command) and it works fine.
You can stack multiple commands per line without being after a repeat command, without needing 3 digits per parameter, and you can also have multiple repeat commands on one line, taking advantage of the new end repeat command. Just performed another test, halfway through writing this. This command tests the nested repeats, and goes something like this:



If I stopped playing about with this trying to cover the screen with AUFC maybe I could actually get this thing completely finished and compiled.

Don't visit the Mad Matt Games Website
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 24th May 2003 04:04
Sephnroth: What part of the UK are you from?
That turtle programming guide, does it have any good effects? I could do with something else to waste my time on, now I have 2 weeks study leave with no exams - good stuff.

Don't visit the Mad Matt Games Website
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 24th May 2003 04:41
Compiled version finished with help and 4 examples. Too tired to upload just now.
Will do so in the morning.

Don't visit the Mad Matt Games Website
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 24th May 2003 13:16
Compiled version uploaded. Download from here.

Don't visit the Mad Matt Games Website

Login to post a reply

Server time is: 2024-04-19 03:43:29
Your offset time is: 2024-04-19 03:43:29