The 20line or less weekly contest!
Author |
Message |
deltamanx
|
Posted: Fri Jan 08, 2010 9:24 pm Post subject: 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
|
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.
So ya. Now take a look at this in perspective...
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
chrisbrown
|
Posted: Fri Jan 08, 2010 10:01 pm Post subject: 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
|
Posted: Fri Jan 08, 2010 10:22 pm Post subject: 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
|
20 line on the mark.
I call it: Linear art.
|
|
|
|
|
|
petree08
|
Posted: Thu Apr 08, 2010 11:47 am Post subject: RE:The 20line or less weekly contest! |
|
|
It's cool man, but art? maybe not.
|
|
|
|
|
|
prateke
|
|
|
|
|
Tony
|
Posted: Wed May 12, 2010 6:33 pm Post subject: Re: The 20line or less weekly contest! |
|
|
prateke @ Wed May 12, 2010 5:50 pm wrote: Fastest factor finder in this forum!!
You can make it run in O(logN) instead of O(N) with one tiny change.
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Geniis
|
Posted: Thu May 13, 2010 1:04 am Post subject: 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) :
Turing: |
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
|
Posted: Thu May 13, 2010 8:57 am Post subject: Re: The 20line or less weekly contest! |
|
|
Geniis @ Thu May 13, 2010 1:04 am wrote: 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.
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Thu May 13, 2010 9:46 am Post subject: Re: The 20line or less weekly contest! |
|
|
Brightguy @ Thu May 13, 2010 8:57 am wrote: The log(N) was probably a misprint
Right. I was thinking of N^0.5 (that being sqrt(N)).
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
BITISCT
|
Posted: Thu Aug 12, 2010 12:29 am Post subject: Re: The 20line or less weekly contest! |
|
|
Very, very minimal langton's ant. Included is the original without lines cut out
Description: |
|
Download |
Filename: |
Langton's ant(short).t |
Filesize: |
1.5 KB |
Downloaded: |
250 Time(s) |
Description: |
|
Download |
Filename: |
Langton's ant.t |
Filesize: |
532 Bytes |
Downloaded: |
247 Time(s) |
|
|
|
|
|
|
goroyoshi
|
Posted: Sat Apr 02, 2011 7:45 pm Post subject: Re: The 20line or less weekly contest! |
|
|
are we still doing this?
if so then
Turing: |
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
|
Posted: Sat Apr 02, 2011 8:28 pm Post subject: 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
|
Posted: Thu Nov 03, 2011 2:26 am Post subject: 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
Turing: |
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
|
Posted: Thu Nov 03, 2011 7:51 am Post subject: Re: RE:The 20line or less weekly contest! |
|
|
mirhagk @ Thu Nov 03, 2011 2:26 am wrote: 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
|
Posted: Thu Nov 03, 2011 5:55 pm Post subject: 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.
|
|
|
|
|
|
|
|