Computer Science Canada

The Paint Program Contest

Author:  Sean [ Fri Feb 08, 2008 5:31 pm ]
Post subject:  The Paint Program Contest

The Paint Program Contest (P.P.C)

Objective:
To successfully create a Paint Program in a programming language, preferably Turing. To establish an efficient, unique and user-friendly program that allows users to design, draw and create pictures using your functions, procedures and the language predefined designs. The program can either use GUI or Non-GUI, decidable by you. All programs must meet the requirements to have atleast completed the objective.

Requirements:
Number of Designs: Minimum of Five
Number of Colours: Minimum of Eight
Number of Programming Lines: As many as needed
Style of Programming: GUI or Non-GUI
Documentation: Required
Due Date: Meet the Stated Due Date
Input: Keyboard and/or Mouse Input


Submission:
Due Date: February 15th, 2008
Submission Style: Submit .exe format on forums, and PM Vilament with Source Code to ensure your code is not stolen.
Sumbission Detail: Submit a brief description of what it does, and if you used GUI or not.


Rules:
Arrow Code with the help of tutorials, class work and knowledge.
Arrow Do not steal, or ask people to code it for you.
Arrow Do feel free to ask a judge, or represenative on what else is allowed.
Arrow Do not submit a program created by someone else, that is on the site, or off the site.
Arrow Be creative, express your talent through this program.


Judges/Represenatives:
Host/Judge: Vilament
Other Judges: Please Contact if you have a great understanding of any other language then Turing.
Admins: All Admins (Allowed to Lock, or Delete any inappropiate posts, submissions and/or spamming of the thread).


Prizes:
Prizes: Prizes awarded to those who are judged highest. They will receive bits depending on where they finish.
Donations: Feel free to donate any bits that you wish to have rewarded to the winners, this can be done by donating to Vilament.

Author:  StealthArcher [ Fri Feb 08, 2008 5:37 pm ]
Post subject:  RE:The Paint Program Contest

I'm in, here's my 50 bit entrance fee.

Author:  Tony [ Fri Feb 08, 2008 5:43 pm ]
Post subject:  RE:The Paint Program Contest

@Vilament - I think it would be a good idea to put up your own submission first, as a reference.

The requirements seem kind of sketchy. Number of colours? Documentation? Hmm... and 1 week deadline is way too short for something like this.

Author:  Sean [ Fri Feb 08, 2008 5:53 pm ]
Post subject:  Re: The Paint Program Contest

Updates:

Arrow Due Date: March 8th, 2008.

Author:  StealthArcher [ Fri Feb 08, 2008 5:59 pm ]
Post subject:  RE:The Paint Program Contest

Is it okay if I use Cervantes text field for this?

Author:  Sean [ Fri Feb 08, 2008 6:20 pm ]
Post subject:  Re: The Paint Program Contest

Might I ask what it is?

Author:  Tony [ Fri Feb 08, 2008 6:21 pm ]
Post subject:  RE:The Paint Program Contest

I'm also thinking that the submissions should be posted as source code. After all, we're here to learn. To avoid any "viewed source before deadline" issues, it could be a protected .zip file.

Refer to zylum's tetris challenge for the process.

Unless, of course, there are objections to this.

Author:  Sean [ Fri Feb 08, 2008 6:53 pm ]
Post subject:  Re: The Paint Program Contest

Agreed with Tony, new submission status now.

.Zip format with your .exe and Source Code.

Author:  StealthArcher [ Fri Feb 08, 2008 7:25 pm ]
Post subject:  RE:The Paint Program Contest

Cervantes started making gui repolacements as a way to teach coding with classes in turing. He made a button, which i havew improved some and use, and a text filed replacement. Which is why I asked, because I would like to use it, rather than code from scratch as it is about 500 lines. I do understand the code.

Author:  Nick [ Fri Feb 08, 2008 7:26 pm ]
Post subject:  RE:The Paint Program Contest

got it all done except colors plus bonus features (ex: undo,more shapes, more colors, save/load,etc...)

Author:  McKenzie [ Fri Feb 08, 2008 8:31 pm ]
Post subject:  Re: The Paint Program Contest

Are you sure you're the most qualified to evaluate a paint program? I've evaluated about 400 paint programs in the past 7 years Wink

Author:  Mackie [ Fri Feb 08, 2008 10:34 pm ]
Post subject:  RE:The Paint Program Contest

Are all languages accepted?

Author:  fishtastic [ Fri Feb 08, 2008 10:37 pm ]
Post subject:  Re: The Paint Program Contest

Wow! The one I posted in the Turing submission part meets all your requirement. Laughing


var version := "1.2" var loadtime := 0.0 var mx, my, mc : int var selected := 255 var chosen := 1 var key : array char of boolean var actions : flexible array 1 .. 0 of int var ax1, ax2, ay1, ay2 : flexible array 1 .. 0 of int var step : flexible array 1 .. 0 of int var aColor : flexible array 1 .. 0 of int var thick : flexible array 1 .. 0 of int var toolName : array 0 .. 9 of string := init ("erasor", "Line", "brush", "rectangle", "oval", "star", "mapleleaf", "fillshape", "fillblank", "no") var thickness := 1.0 var tool := 1 var name := "" View.Set ("offscreenonly") proc help var ch : char cls color (red) put "Welcome to Turing Paint " + version put "Press 'h' at ANY TIME for HELP" put "" color (black) put "select colour at the bottom of the window" put "press '0'~'9' to select tools" put "press '+' and '-' to adjust line thickness" put "press 'z' to move 1 step back" put "press 's' to save and 'l' to load" put "press 'w' and 'q' to selection previous and next colour" put "" put "press any key to continue" View.Update ch := getchar end help proc newAll new actions, upper (actions) + 1 new ax1, upper (ax1) + 1 new ay1, upper (ay1) + 1 new ax2, upper (ax2) + 1 new ay2, upper (ay2) + 1 new aColor, upper (aColor) + 1 new thick, upper (thick) + 1 actions (upper (actions)) := 0 aColor (upper (aColor)) := 0 ax1 (upper (ax1)) := 0 ay1 (upper (ay1)) := 0 ax2 (upper (ax1)) := 0 ay2 (upper (ay1)) := 0 thick (upper (thick)) := 0 end newAll proc back if upper (actions) > 0 then loop exit when upper (actions) = step (upper (step)) new actions, upper (actions) - 1 new ax1, upper (ax1) - 1 new ay1, upper (ay1) - 1 new ax2, upper (ax2) - 1 new ay2, upper (ay2) - 1 new aColor, upper (aColor) - 1 new thick, upper (thick) - 1 end loop new step, upper (step) - 1 delay (50) end if end back proc drawAll for i : 1 .. upper (actions) if actions (i) = 0 then Draw.ThickLine (ax1 (i), ay1 (i), ax2 (i), ay2 (i), thick (i), white) elsif actions (i) = 1 then Draw.ThickLine (ax1 (i), ay1 (i), ax2 (i), ay2 (i), thick (i), aColor (i)) elsif actions (i) = 2 then Draw.ThickLine (ax1 (i), ay1 (i), ax2 (i), ay2 (i), thick (i), aColor (i)) elsif actions (i) = 3 then drawfillbox (ax1 (i), ay1 (i), ax2 (i), ay2 (i), aColor (i)) elsif actions (i) = 4 then drawfilloval (ax1 (i), ay1 (i), ax2 (i) - ax1 (i), ay2 (i) - ay1 (i), aColor (i)) elsif actions (i) = 5 then drawfillstar (ax1 (i), ay1 (i), ax2 (i), ay2 (i), aColor (i)) elsif actions (i) = 6 then drawfillmapleleaf (ax1 (i), ay1 (i), ax2 (i), ay2 (i), aColor (i)) elsif actions (i) = 7 then drawfill (ax1 (i), ay1 (i), aColor (i), 0) elsif actions (i) = 8 then drawfill (ax1 (i), ay1 (i), 255, aColor (i)) end if end for end drawAll proc showStat if (Time.Elapsed - loadtime not= 0) then color (black) put "FPS:", 1000 / (Time.Elapsed - loadtime) : 4 : 0, " Total Points:", upper (ay2) color (red) put toolName (tool), " tool" put "thickness: ", round (thickness), " colour #: ", chosen end if end showStat proc showAll for i : 0 .. maxcolor drawfillbox (round ((maxx / maxcolor) * i), 0, round ((maxx / maxcolor) * i) + 3, 20, i) end for drawfillbox (0, 20, maxx, 40, chosen) if my < 20 then drawfillbox (0, 20, maxx, 40, selected) end if loadtime := Time.Elapsed end showAll proc save (name : string) var OUT : int open : OUT, name, put for i : 1 .. upper (ax1) put : OUT, ax1 (i) put : OUT, ay1 (i) put : OUT, ax2 (i) put : OUT, ay2 (i) put : OUT, actions (i) put : OUT, thick (i) put : OUT, aColor (i) end for put "saved!!" delay (1000) close : OUT end save proc load (name : string) for i : 1 .. upper (ax1) + 1 back end for var IN : int open : IN, name, get newAll loop get : IN, ax1 (upper (ax1)) get : IN, ay1 (upper (ay1)) get : IN, ax2 (upper (ax2)) get : IN, ay2 (upper (ay2)) get : IN, actions (upper (actions)) get : IN, thick (upper (thick)) get : IN, aColor (upper (aColor)) exit when eof (IN) = true newAll end loop put "loaded!!" delay (1000) close : IN end load proc checkKeys Input.KeyDown (key) if key (chr (ord ("+"))) then thickness += 0.2 elsif key (chr (ord ("-"))) and thickness > 1 then thickness -= 0.2 elsif key (chr (ord ("z"))) then back put "canceled 1 move" View.Update delay (100) elsif key (chr (ord ("h"))) then help elsif key (chr (ord ("s"))) then cls View.Set ("nooffscreenonly") put "File name(type 'cancel' to cancel)" get name if name not= "cancel" then save (name + ".txt") end if View.Set ("offscreenonly") elsif key (chr (ord ("l"))) then cls View.Set ("nooffscreenonly") put "File name(type 'cancel' to cancel)" get name if name not= "cancel" then load (name + ".txt") end if View.Set ("offscreenonly") elsif key (chr (ord ("q"))) then if chosen > 0 then chosen -= 1 end if elsif key (chr (ord ("w"))) then if chosen < 255 then chosen += 1 end if end if for i : 0 .. 9 if key (chr (ord (intstr (i)))) then tool := i end if end for end checkKeys help loop cls mousewhere (mx, my, mc) showStat drawAll showAll checkKeys if mc = 1 and my > 20 then new step, upper (step) + 1 step (upper (step)) := upper (ax1) newAll actions (upper (actions)) := tool aColor (upper (aColor)) := chosen ax1 (upper (ax1)) := mx ay1 (upper (ay1)) := my thick (upper (thick)) := round (thickness) loop cls mousewhere (mx, my, mc) ax2 (upper (ax2)) := mx ay2 (upper (ay2)) := my showStat drawAll showAll exit when mc = 0 if tool = 0 or tool = 2 then newAll actions (upper (actions)) := tool aColor (upper (aColor)) := chosen ax1 (upper (ax1)) := mx ay1 (upper (ay1)) := my thick (upper (thick)) := round (thickness) end if View.Update delay (10) end loop elsif my < 20 and round (mx / (maxx / maxcolor)) > -1 and round (mx / (maxx / maxcolor)) <= maxcolor then selected := round (mx / (maxx / maxcolor)) if mc = 1 then chosen := round (mx / (maxx / maxcolor)) end if end if View.Update delay (20) end loop

Author:  michaelp [ Sat Feb 09, 2008 8:45 am ]
Post subject:  Re: RE:The Paint Program Contest

Mackie @ Fri Feb 08, 2008 10:34 pm wrote:
Are all languages accepted?

Read the first sentence of the first post and you'll get it. Very Happy
He said in any language, but preferably Turing.

Author:  McKenzie [ Sat Feb 09, 2008 9:44 am ]
Post subject:  Re: The Paint Program Contest

As I alluded to I've been giving this as a major assignment for the past seven years. They are all doing it in Python this year, but I'm not sure if any will want to share their hard earned code on-line. I do think my assignment sheet may be useful for this competition, as it gives a standardized evaluation sheet. You will notice that the marks are are not even. Some of the marks are very easy to get and some of the marks are very hard to get. This exists to correct the standard "double-hump" distribution of CS marks (where 70% of the class gets 90% and 30% gets 50%)

Author:  Sean [ Sat Feb 09, 2008 10:35 am ]
Post subject:  Re: The Paint Program Contest

Reminder Any language is useable, any codes that you previously made are useable.
Anything that will benifit you will be allowed, but not stealing others code.

Mackenzie, I could use you as a judge then if you wish?

Author:  McKenzie [ Sat Feb 09, 2008 2:32 pm ]
Post subject:  Re: The Paint Program Contest

If you get stuck marking them I can help you out but you will probably enjoy marking them whereas to me it's like work. I would suggest you use a marking/judging scheme so that everyone knows how they are being judged before they start. You can use mine, but keep in mind, mine is designed to help smooth out marks. How you design yours should reflect what you are trying to do. If you are trying to decide who's is the "best" mine won't do that.

Author:  Sean [ Tue Feb 12, 2008 1:00 pm ]
Post subject:  Re: The Paint Program Contest

code:

Evaluation                  /60   
/5      Attractive Layout     - Laying out tools with reasonable proportions, having a nice title, things lined-up correctly, good colour choices ?.
/5      Select Tools  - The if structure in your program that know which tool is picked
/5      Stamps pictures       - Letting the user draw small bitmaps on the canvas. There should be at least 6 pictures, and ideally they should match some sort of theme.
/5      Comments      - Must have good head comments, explain important variables, explain what each function does, and explain what blocks of complicated code do.
/5      Division into functions       - The program must be divided up into functions, your mainline and each of your functions should each be no more than 50 lines.
/5      Load/Save     - Load the canvas from a bitmap file, Save canvas to a bitmap file. For full marks the user must enter the file names.
/5      Attention to Detail   - Does it seem professional? Does the user have to do things in the order that you want them to or can they just sit down and start using it? Are things properly clipped to the canvas? Does the way you use the left and right mouse buttons seem obvious? Do you give useful feedback, like which colour is currently selected, what pixel location the mouse is at aver the canvas?
/5      Freehand Draw - That pencil thing
/5      Basic shapes  - Box, Oval and line. For the basic version you can either click twice to define the dimensions or mousedown-move-mouseup to define the dimensions. Pre-viewing the shape as it is drawn takes some work and is 2 "extra" marks.
/5      Pick Colour   - Allow the user to select what colour the pencil and shapes are drawn in.
/10     Individual Features  - Marks based on how hard/useful e.g.
1-spray paint, 2-pre-view shapes, 2-paint bucket, 2-highlight selected tool?


This is the evaluation that we will be using, for a hard-copy reference download Mackenzie's submission on the first page and print it. We are using his evaluation, it basically had all I wanted.

~Thanks Mckenzie.

Author:  ericfourfour [ Tue Feb 12, 2008 5:07 pm ]
Post subject:  RE:The Paint Program Contest

You might want to change the evaluation to a more informal one. Point it toward hobbyists instead of students.

For example, the "Division into functions" part makes sense until the end when it specifies a limit on their size.

Another one is the "Select Tools" part. Some people won't have an if structure to know which tool is picked. I know I would use object orientation and have currentTool object.

Some can be combined as well. "Comments" and "Division into functions" can be combined into "readability".

Author:  Nick [ Tue Feb 12, 2008 5:24 pm ]
Post subject:  RE:The Paint Program Contest

also stamps weren't specified nor are really needed

Author:  Sean [ Tue Feb 12, 2008 6:10 pm ]
Post subject:  Re: The Paint Program Contest

Its just a simple structure, I'll most likly change the evaluation, this is just one I am rolling with right now.

Author:  Sean [ Thu Mar 06, 2008 2:42 pm ]
Post subject:  Re: The Paint Program Contest

Alright, the contest is still running, I really haven't been available to update the thread due to personal things. I am still accepting codes, so you got a bit of time left to submit those paint programs.


: