
-----------------------------------
MihaiG
Thu Feb 26, 2009 1:54 am

The 20line or less weekly contest!
-----------------------------------
Update:
Since this started thursday, the submitted code will be reviewed wednesday night(or thursday morning) based on submission time(server time), Users and mods can both participate(cept mods dont get bits) winners will recieve 100bits and a "virtual" trophy/badge for each week.


Hey guys,

ive really gotten into having fun in optimizing code so i want to start a weekly event, where users submit programs written in 20 lines or less.
Users will be encouraged to be creative and improve on the code and ideas of others. Some basic rules i want to lay out are:

1.Submissions must have a total length(20 lines or less, commenting does not count).
2.Code must be commented(where not obvious, assume we have only programmed for 3 weeks)
3.Ideas and code may be used from previous submissions in the case where the resulting code is at least 3 lines shorter than the previous(and or similar) version.
4. Reasonable explanations must be included with each submission.
5. Prizes of 100bit will be awarded to weekly winners :)

And to start it off, i will warp your minds with the Sierpinski Triangle.

http://img14.imageshack.us/img14/3638/sierpinski.png

So thats my first submission i am waiting for your submissions!

*edit note you can use a max screen for my program, but it works best with square displays where the window size is a 2^n :]*[/img]

-----------------------------------
Tony
Thu Feb 26, 2009 3:20 am

Re: The 20line or less weekly contest!
-----------------------------------
i need a temporary value to store the AND operation to since turing doesnt like using it directly
It might not like it, but it works.

View.Set ("graphics:512;512")
for i : 0 .. maxx*maxy - 1
    Draw.Dot ((i mod maxx)+1, (i div maxx) + 1, ceil((((i mod maxx)+1) & ((i div maxx)+1))/maxint)*black)
end for

For comments, refer to MihaiG's program above. This does the same thing.

Though calling this "optimized" would be misleading, as it makes the solution worse, in just about every way imaginable.

-----------------------------------
The_Bean
Thu Feb 26, 2009 11:00 pm

Re: The 20line or less weekly contest!
-----------------------------------
I propose a line length limit, not because of multiple commands on one line, but to prevent me from doing this...

This is to all those people that were trying to make those projectile games a while back.

View.Set ("graphics:1024,400;nobuttonbar;title:Target Practise with Physics;position:center,center")
var velocity : real
var angle : real
var box:int:=Rand.Int(50,maxx)
Draw.FillBox(box-50,0,box+50,20,3)
Draw.ThickLine(0,0,20,10,5,28)
put "Enter power in m/s where 1 pixel = 1 meter (0..100): " ..
get velocity
put "Enter Angle in degrees (1..89): " ..
get angle
for x : 0 .. floor ((velocity ** 2 * sind (2 * angle)) / 9.8)
    Draw.ThickLine(x,round(((-((velocity*sind(angle))*(2*velocity*sind(angle))/9.8*.5-4.9*(.5*(2*velocity*sind(angle))/9.8)**2))/((velocity**2*sind(2*angle))/9.8*.5)**2)*(x-.5*(velocity**2*sind(2*angle))/9.8)**2+((velocity*sind(angle))*(2*velocity*sind(angle))/9.8*.5-4.9*(.5*(2*velocity*sind(angle))/9.8)**2)),x+1,round(((-((velocity*sind(angle))*(2*velocity*sind(angle))/9.8*.5-4.9*(.5*(2*velocity*sind(angle))/9.8)**2))/((velocity**2*sind(2*angle))/9.8*.5)** 2)*((x+1)-.5*(velocity**2*sind(2*angle))/9.8)**2+((velocity*sind(angle))*(2*velocity*sind(angle))/9.8*.5-4.9*(.5*(2*velocity*sind(angle))/9.8)**2)),3,7)
    delay(2)
end for
if (velocity ** 2 * sind (2 * angle)) / 9.8>=box-50 and (velocity ** 2 * sind (2 * angle)) / 9.8 254 or ((a1 * a1) + (b1 * b1)) > 4
        end loop
        drawdot (x + 100, y + 100, lp)
    end for
end for


-----------------------------------
copthesaint
Wed Apr 01, 2009 12:15 pm

Re: The 20line or less weekly contest!
-----------------------------------
Here is a 19 line program that will take a string and split up the values inbetween each space.
This is usefull for online programs and loading txt files.

var First, Last, NextValue : int
var Words : array 1 .. 10000 of string
procedure GetStrings (S : string)
    First := 1
    NextValue := 0
    for i : 1 .. length (S)
        if S (i) = " " then
            Last := i - 1
            NextValue += 1
            Words (NextValue) := ""
            for s : First .. Last
                Words (NextValue) += S (s)
            end for
            First := i + 1
        end if
    end for
end GetStrings
GetStrings ("Enter any string and the program will split it and give the number of words")

-----------------------------------
saltpro15
Wed Apr 01, 2009 3:44 pm

RE:The 20line or less weekly contest!
-----------------------------------
here is hello world


put "Hello World!"


in 1 line! how amazing!

-----------------------------------
SNIPERDUDE
Wed Apr 01, 2009 3:57 pm

RE:The 20line or less weekly contest!
-----------------------------------
I vote saltpro15 the weekly winner. :P

-----------------------------------
saltpro15
Wed Apr 01, 2009 4:43 pm

RE:The 20line or less weekly contest!
-----------------------------------
yay, thanks SNIPERDUDE :p  also, excellent video in your signature, I don't even like hip-hop and I thought it was great

-----------------------------------
copthesaint
Wed Apr 01, 2009 5:08 pm

RE:The 20line or less weekly contest!
-----------------------------------
Umm What are you two talking about... This is Kinda off topic don't you think...

-----------------------------------
saltpro15
Wed Apr 01, 2009 5:28 pm

RE:The 20line or less weekly contest!
-----------------------------------
Yes it is, my bad.  I should get cracking on a real submission

-----------------------------------
Zren
Wed Apr 01, 2009 8:08 pm

Re: The 20line or less weekly contest!
-----------------------------------
Here is a 19 line program that will take a string and split up the values inbetween each space.
This is usefull for online programs and loading txt files.

var First, Last, NextValue : int
var Words : array 1 .. 10000 of string
procedure GetStrings (S : string)
    First := 1
    NextValue := 0
    for i : 1 .. length (S)
        if S (i) = " " then
            Last := i - 1
            NextValue += 1
            Words (NextValue) := ""
            for s : First .. Last
                Words (NextValue) += S (s)
            end for
            First := i + 1
        end if
    end for
end GetStrings
GetStrings ("Enter any string and the program will split it and give the number of words")

Your program doesn't catch the last word into the array without having a trailing space. Just pointing that out dude. Good try though.

-----------------------------------
SNIPERDUDE
Wed Apr 01, 2009 10:56 pm

RE:The 20line or less weekly contest!
-----------------------------------
do note the difficulty it would be to add error checking with such limited room.  Although just to make it work in this case have the function just add one to the output number.

-----------------------------------
BBPProductions
Thu Jun 04, 2009 9:42 am

RE:The 20line or less weekly contest!
-----------------------------------
I relly liked the sphere!

-----------------------------------
stas054
Sat Jun 13, 2009 7:58 pm

RE:The 20line or less weekly contest!
-----------------------------------
var pie:string:="I  maxx or Y < 1 or Y > maxy then
        X := 1
        Y := maxy div 2
    end if
    drawfilloval ((maxx div 2) + X, Y, 2, 2, 7)
    drawfilloval ((maxx div 2) - X, Y, 2, 2, 7)
    View.Update
end loop

[/code]

-----------------------------------
petree08
Thu Nov 12, 2009 9:45 am

RE:The 20line or less weekly contest!
-----------------------------------
so i don't know if it is an ink blot generator any more but i messed with it more and got this

[code]
var X, Y : int
X := 1
Y := maxy div 2
for C : 1 .. Rand.Int (800, 1700)
    X := X + Rand.Int (-1, 1)
    Y := Y + Rand.Int (-1, 1)
    if X < -maxx or X > maxx or Y < 1 or Y > maxy then
        X := 1
        Y := maxy div 2
    end if
    drawdot ((maxx div 2) + X, Y, 7)
    drawdot ((maxx div 2) - X, Y, 7)
    View.Update
end for

[\code]


i like this one better

-----------------------------------
mirhagk
Tue Nov 24, 2009 12:25 pm

Re: The 20line or less weekly contest!
-----------------------------------
um so yeah they should have posted a line length limit or else i could just do this

its mona lisa and random special drawing effects in 11 lines of code. (without special effects its 7 lines of code).

no i did not use a picture file at all, it draws it point by point.

Wanna know how i did it, well first i modified the earlier picture to turing code into the following

[code]
var image, stream : int
var filename : string
cls
put "Enter the image file location: " ..
get filename : *
image := Pic.FileNew (filename)
View.Set ("graphics:" + intstr (Pic.Width (image)) + "," + intstr (Pic.Height (image)) + ",nobuttonbar")
Pic.Draw (image, 0, 0, picCopy)
open : stream, filename + ".t", put
put : stream, "View.Set (\"graphics:" + intstr (Pic.Width (image)) + "," + intstr (Pic.Height (image)) + ",nobuttonbar\")"
put : stream, "var pic:array 1.." + intstr (Pic.Width (image)) + ",1.." + intstr (Pic.Height (image)) + " of int:=init(" ..
for x : 1 .. Pic.Width (image)
    View.Set ("title:Converting..." + intstr (round ((x / maxx * 100))) + "%")
    for y : 1 .. Pic.Height (image)
        put : stream, intstr (whatdotcolor (x, y)) + "," ..
    end for
end for
put : stream, ")\nfor x:1.." + intstr (Pic.Width (image)) + "\n\tfor y:1.." + intstr (Pic.Height (image)) + "\n\t\t" ..
put : stream, "Draw.Dot(x,y,pic(x,y))\n\tend for\nend for"
close : stream
[/code]

instead of thousands of Draw.Dot commands (and close to a million kb for some pictures) it creates an array of all the points to store a colour variable, then it adds the code to use a for loop and draw the picture using the array.

then i opened the created 7 line program and proceeded to add the special effects.
try it out, and you can create your own programs like this using the above code (which still qualifies for the 20 lines or less btw)

-----------------------------------
Zasalamel
Mon Nov 30, 2009 7:00 pm

RE:The 20line or less weekly contest!
-----------------------------------
Yeah mirhagk! i didn't think you would post it...

-----------------------------------
mirhagk
Tue Dec 08, 2009 12:26 pm

RE:The 20line or less weekly contest!
-----------------------------------
didn't think I'd post what?? the mona lisa thing, or the code used to make it??

-----------------------------------
Superskull85
Wed Dec 09, 2009 12:02 am

Re: The 20line or less weekly contest!
-----------------------------------
I was wondering how small I could make my base conversion program, and still make it usable (not entirely "the best").

Any base 2-36 to decimal (10):

var Num : string
function IsValid (Num : string) : boolean
    if length (Num) not= 0 then
        result ((ord (Num (1)) >= 48 and ord (Num (1)) = 65 and ord (Str.Upper (Num (1))) = 48 and ord (Num (1)) = 10 then
        result chr (Num - 10 + 65)
    else
        result intstr (Num)
    end if
end SetValue
function ConvertDecBase (Num, Base : int) : string
    if Num = 0 then
        result ""
    end if
    result ConvertDecBase (Num div Base, Base) + SetValue (Num mod Base)
end ConvertDecBase
put "Input a decimal number, and a base (number:base): " ..
get Num
if strintok (Num (1 .. index (Num, ":") - 1)) then
    put ConvertDecBase (strint (Num (1 .. index (Num, ":") - 1)), strint (Num (index (Num, ":") + 1 .. *)))
end if
I am pretty sure the algorithms will convert any number given. If not let me know. :)

I know this is not the best algorithm that could be designed, but it gave me a challenge and made me look at the problem in a whole different way.

-----------------------------------
Tony
Wed Dec 09, 2009 12:12 am

Re: The 20line or less weekly contest!
-----------------------------------
I know this is not the best algorithm that could be designed
Wait, is the algorithm "use [tdoc]strint[/tdoc]", or are you talking about validation/parsing-input?

-----------------------------------
Superskull85
Wed Dec 09, 2009 6:10 pm

Re: The 20line or less weekly contest!
-----------------------------------
Using strint would accomplish the same thing but would not allow you to express numbers in other bases as you would be limited to the bases 2 through 36.

Using my method you could convert a base one number, such as "11111" into decimal (would be five) if you wanted to (you cannot convert decimal to base one using my method).

Also by adding/changing a couple of lines you could represent all the bases between 2 and 62 using all numerical characters (0-9), and all upper case (A-Z) and lower case (a-z) letters.

Any base 1-36 to decimal (10):
var Num : string
function IsValid (Num : string) : boolean
    if length (Num) not= 0 then
        result ((ord (Num (1)) >= 48 and ord (Num (1)) = 65 and ord (Str.Upper (Num (1))) = 97 and ord (Str.Upper (Num (1))) = 48 and ord (Num (1)) = 65 and ord (Num (1)) = 36 then
        result chr (Num - 36 + 97)
    elsif Num >= 10 then
        result chr (Num - 10 + 65)
    else
        result intstr (Num)
    end if
end SetValue
function ConvertDecBase (Num, Base : int) : string
    if Num = 0 then
        result ""
    end if
    result ConvertDecBase (Num div Base, Base) + SetValue (Num mod Base)
end ConvertDecBase
put "Input a decimal number, and a base (2-62) (number:base): " ..
get Num
if strintok (Num (1 .. index (Num, ":") - 1)) then
    put ConvertDecBase (strint (Num (1 .. index (Num, ":") - 1)), strint (Num (index (Num, ":") + 1 .. *)))
end if
You cannot do this with strint.

So to be specific I should of said, "I was wondering how small I could make my base conversion program, without using strint and still make it usable (not entirely "the best")." instead in my previous post.

-----------------------------------
Tony
Wed Dec 09, 2009 6:37 pm

RE:The 20line or less weekly contest!
-----------------------------------
Oh, I see what's going on now. At first I just saw the use of strint, but now your description also explains how this works beyond the limitations. Nice.

-----------------------------------
Magix
Thu Dec 10, 2009 5:55 pm

Another Submission
-----------------------------------
Here I am with another submission...a prime number finder... with Turing! You enter a low number and a high number, and the program can list out for you all the prime numbers between them, and in the end, it outputs the total number of prime numbers. Only problem is that, because of my noob coding and Turing's un-flexibility, it runs very slowly if the gap between the numbers you enter is too big. If you enter 1 and 10,000, it runs just fine, but enter 1 and 100,000, and the thing gets slower. It still works though.

[code]
var iNum1, iNum2, iDiv, iPrm : int
iPrm := 0                                   %Initial value
put "Starting number: " ..                  %Caption
get iNum1                                   %Get lower number
put "Ending number: " ..                    %Caption
get iNum2                                   %Get higher number
put "List of prime numbers between ", iNum1, " and ", iNum2, "..."
for count : iNum1 .. iNum2                  %Starts for loop to execute
    iDiv := 0                               %Set number of factors to 0
    for fDivider : 1 .. iNum2               %Starts divident finder
        if count mod fDivider = 0 then      %If remainder=0, then
            iDiv := iDiv + 1                %Add 1 to total number of factors
        end if                              %End if
    end for                                 %End for loop
    if iDiv = 2 then                        %If it has no factors...
        iPrm := iPrm + 1                    %Add 1 to number of prime numbers
        put count                           %Output number
    end if                                  %End if
end for
put "There are ", iPrm, " prime numbers between ", iNum1, " and ", iNum2, "."
[/code]

This version is super-compressed to fit into 20 lines. If you want to see the full version, [url=http://compsci.ca/v3/viewtopic.php?p=200295]click here.

-----------------------------------
mirhagk
Sun Dec 13, 2009 9:58 am

RE:The 20line or less weekly contest!
-----------------------------------
Hey just a little tip
this section:


for fDivider : 1 .. iNum2
    if count mod fDivider = 0 then
        iDiv := iDiv + 1
    end if
end for

you don't need to check if it's divisible by one right? so start it at 2 (will increase speed a little)
also you already know it's divisble by itself and not divisible by numbers greater than itself. So you only need to check for numbers smaller than itself (count-1)
heres what that section should look like (also remember to change the if statement checking how many factors it has, it should have 0 with the new improvements to the code)


for fDivider : 2 .. count-1             
        if count mod fDivider = 0 then      
            iDiv := iDiv + 1               
        end if                              
    end for


-----------------------------------
Tony
Sun Dec 13, 2009 1:56 pm

Re: RE:The 20line or less weekly contest!
-----------------------------------
So you only need to check for numbers smaller than itself (count-1)
One might notice that there is a lot more numbers one does not need to check to see if a number is prime or not.

Do we need to check count-2? -3? How many can we take off, and still be certain in the true/false answer for number being prime?

-----------------------------------
DemonWasp
Sun Dec 13, 2009 11:32 pm

RE:The 20line or less weekly contest!
-----------------------------------
...and do we really need to know how many factors the number has? Isn't it enough to know that it has factors other than 1 and itself?

-----------------------------------
mirhagk
Sun Dec 13, 2009 11:37 pm

RE:The 20line or less weekly contest!
-----------------------------------
wouldnt it be more effecient to keep an array of all the numbers set to true then set them to false if you find a number it's divisible by.

then when your checking the number you can check against only if the number is true (so it only checks against prime numbers).

-----------------------------------
ecookman
Sun Dec 13, 2009 11:39 pm

RE:The 20line or less weekly contest!
-----------------------------------
some really cool stuff here, I am just for fun going to see if I can make anything like these. Wait, isn't it possible to code everything in one line?

-----------------------------------
mirhagk
Sun Dec 13, 2009 11:43 pm

RE:The 20line or less weekly contest!
-----------------------------------
with a ; but otherwise no. (well maybe some programs but not most useful programs)

-----------------------------------
Tony
Sun Dec 13, 2009 11:57 pm

Re: RE:The 20line or less weekly contest!
-----------------------------------
wouldnt it be more effecient to keep an array of all the numbers...
If you want to check a range of numbers, yes, you can use a sieve (and it would be ridiculously better); but it's not really applicable if we are checking just one number (well, it could be used in a way that we find all the primes up the current number we are checking, but that's extra work).

-----------------------------------
mirhagk
Mon Dec 14, 2009 2:09 am

RE:The 20line or less weekly contest!
-----------------------------------
well the program i have in mind would cancel out checking numbers if they have been declared by the program to be non-prime

-----------------------------------
deltamanx
Fri Jan 08, 2010 9:24 pm

Re: The 20line or less weekly contest!
-----------------------------------
This might not look like much; but there's a reason I put it here.

[code]
loop
     put "NOOB" ..
end loop
[/code]

This would normally do nothing special right...
But guess what happened when I ran this with arguments to save everything it outputted to a file.
And then left it running while I was off on a 10 day vacation?
Result?
8.67 GB file composed of only NOOBNOOBNOOBNOOB...
I would have attached, but you put a limit. :P

So ya. Now take a look at this in perspective...

-----------------------------------
chrisbrown
Fri Jan 08, 2010 10:01 pm

RE:The 20line or less weekly contest!
-----------------------------------
What a fantastic waste of computing power. IMO, each NOOB you have there increases your rank on the noob scale.

Also: you could have had a file 4-6 times bigger in the same time had you used a different language... just for perspective.

-----------------------------------
deltamanx
Fri Jan 08, 2010 10:22 pm

Re: The 20line or less weekly contest!
-----------------------------------
Above was a joke submission, here's my real one.

[code]%Made by Deltamanx
setscreen ("graphics:600,600")
var a, b, v, x, y: int := 1
for z : 0 .. 800 by 25
    drawline (b, a, x + z, y, black)
    drawline (a, b, y, x + z, black)
    drawline (b, a, y, x + z, yellow)
    drawline (a, b,  x + z,y, yellow)
    drawline (1, 1, 600, 600 - z, blue)
    drawline (1, 1 + z, 600, 600, blue)
    drawline (300 + z, 1, 400, 600, red)
    drawline (300, 1, 200 - z, 600, red)
    drawline (1, 600 - y, 600, 600 - y, green)
    drawline (1, 1 + y, 600, 1 + y, green)
    a := x
    b := y
    v := v + 1
    y := y + v + 1
    delay (80)
end for
[/code]

20 line on the mark.

I call it: Linear art.

-----------------------------------
petree08
Thu Apr 08, 2010 11:47 am

RE:The 20line or less weekly contest!
-----------------------------------
It's cool man, but art? maybe not.

-----------------------------------
prateke
Wed May 12, 2010 5:50 pm

Re: The 20line or less weekly contest!
-----------------------------------
Fastest factor finder in this forum!!  8-) 

[code]
var x : int;loop;put "Enter number to get factors of: " ..;get x;cls;for i : 1 .. x;if (x mod i) = 0 then;put "Factors of ", x, " are :", i; end if;end for;end loop
[/code]

its also very extremely and awesomely fast 
I can has teh award for this week? :mrgreen: :wink:

-----------------------------------
Tony
Wed May 12, 2010 6:33 pm

Re: The 20line or less weekly contest!
-----------------------------------
Fastest factor finder in this forum!!
You can make it run in O(logN) instead of O(N) with one tiny change.

-----------------------------------
Geniis
Thu May 13, 2010 1:04 am

Re: The 20line or less weekly contest!
-----------------------------------
not sure about O(logN), but i got it O(sqrtN)(at least i think that's what it is) :


const number : nat := 7637325

proc PutFactors (num : nat)
    var cur : nat := 1
    var top : nat := num
    loop
        exit when cur >= top
        if num mod cur = 0 then
            put cur, " " ..
            if cur ** 2 not= num then
                put num div cur, " " ..
            end if
        end if
        top := num div cur
        cur += 1
    end loop
end PutFactors

PutFactors (number)


-----------------------------------
Brightguy
Thu May 13, 2010 8:57 am

Re: The 20line or less weekly contest!
-----------------------------------
not sure about O(logN), but i got it O(sqrtN)(at least i think that's what it is)
Yes, O(sqrt(N)) arithmetic (not bit) operations, where N is the number to factor.  The log(N) was probably a misprint: there is no known polynomial time factoring algorithm.

-----------------------------------
Tony
Thu May 13, 2010 9:46 am

Re: The 20line or less weekly contest!
-----------------------------------
The log(N) was probably a misprint
Right. I was thinking of N^0.5 (that being sqrt(N)).

-----------------------------------
BITISCT
Thu Aug 12, 2010 12:29 am

Re: The 20line or less weekly contest!
-----------------------------------
Very, very minimal langton's ant. Included is the original without lines cut out

-----------------------------------
goroyoshi
Sat Apr 02, 2011 7:45 pm

Re: The 20line or less weekly contest!
-----------------------------------
are we still doing this?
if so then


import GUI %required for buttons
setscreen ("nobuttonbar,graphics:200;200,title:Click masher") %making the screen smaller, taking out the annoying buttons at the top, and putting a title
var count, timecounted : int := 0  %the counters for clicks and time
process timecounter %counts the time and stops when at one minute then puts the amount of clicks done
    loop
        timecounted := Time.Elapsed
        exit when timecounted = 60000
    end loop
    put "In one minute you clicked ", count, " times"
end timecounter
proc lol %counter of clicks, starts on the first click
    if count = 0 then
        fork timecounter
    end if
    count += 1
end lol
var button : int := GUI.CreateButton (0, 0, 1, "Mash me", lol) %the button
loop
    exit when GUI.ProcessEvent %required to make button work
end loop


-----------------------------------
Insectoid
Sat Apr 02, 2011 8:28 pm

RE:The 20line or less weekly contest!
-----------------------------------
If you have a look at some of the other submissions in this thread, you'll see that a button masher is not really contest material.

-----------------------------------
mirhagk
Thu Nov 03, 2011 2:26 am

RE:The 20line or less weekly contest!
-----------------------------------
Not sure if this is still going, but I made one of the scariest programs ever. It has no variables, instead it directly references memory addresses, and it has a nasty optimization because of this. See if you can a) determine what the program does b) determine how it does it. Have fun ;)

17 lines of code, oh and make sure you input a number at the beginning

put nat4@(65536)
get nat4@(65536)
nat2@(65540) := floor (sqrt (nat4@(65536)))
nat4@(65544) := 1
loop
    if nat4@(65536) mod nat2@(65544) = 0 then
        nat2@(65546 + (nat2@(65546) + 1) * 2) := nat2@(65544)
        nat4@(65544) += 1 shl 16 + 1
    else
        nat2@(65544) += 1
    end if
    exit when nat2@(65544) > nat2@(65540)
end loop
nat2@(65544) := 0
loop
    nat2@(65544) += 1
    put nat2@(65536) div nat2@(65546 + nat2@(65544) * 2), ", ", nat2@(65546 + nat2@(65544) * 2), ", " ..
    exit when nat2@(65544) = nat2@(65546)
end loop


EDIT: found another spot for that little optimization, and added a cool feature to the top

-----------------------------------
Beastinonyou
Thu Nov 03, 2011 7:51 am

Re: RE:The 20line or less weekly contest!
-----------------------------------
 a) determine what the program does 


Well, it seems it returns all multiples of that number. As for how it does it.... Are you David Copperfield? or David Blaine?

-----------------------------------
mirhagk
Thu Nov 03, 2011 5:55 pm

RE:The 20line or less weekly contest!
-----------------------------------
It's not super difficult lol, it's essentially just using assembly, have to keep a few things in mind, once you get used to numbers for variables it's not hard, just a bit confusing, I can comment it all if anyone'd like.

-----------------------------------
ClayWall
Tue Nov 22, 2011 12:34 am

Re: The 20line or less weekly contest!
-----------------------------------
Nothing fancy just thought if I'm the only entry this week I might win!  :lol: 

[code] 
var number : int
var key : string (1)
loop
    locate (10, 1)
    for x : 0 .. 255
        color (x)
        put x : 5 ..
    end for
    locate (1, 1)
    put "Enter Number And Press Enter (0,255)"
    get number
    if number >= 0 and number 