GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   I'm still amazing how tiny lines of code can produce such beautiful things. (https://gfy.com/showthread.php?t=792168)

JackJones75 12-14-2007 11:42 AM

I'm still amazing how tiny lines of code can produce such beautiful things.
 
I'm truly in awe of programmers.

It's like when you're a kid and wonder how a needle and those little grooves on the album can produce such wonderful music...

just a punk 12-14-2007 11:48 AM

You will be surprised but it's very easy to learn some programming language and basic algorithms. After that you will be able to write your own code.

When I wrote my first program its was a really magical feeling, because being able to write code is something like to a wizard and cast new spells that create new objects and even new words! I'm not ironic BTW.

sortie 12-14-2007 12:14 PM

Quote:

Originally Posted by PR_Don (Post 13514515)
I'm truly in awe of programmers.

It's like when you're a kid and wonder how a needle and those little grooves on the album can produce such wonderful music...

This thread is useless without code! :1orglaugh

st0ned 12-14-2007 12:15 PM

Quote:

Originally Posted by sortie (Post 13514637)
This thread is useless without code! :1orglaugh

My thoughts exactly.

just a punk 12-14-2007 12:17 PM

Sure. This is not mine, but I think you will like it:
Code:

<SCRIPT type="text/javascript">
var snowmax=45
var snowcolor=new Array("#AAAACC","#DDDDFF","#CCCCDD","#F3F3F3","#F0FFFF")
var snowtype=new Array("Arial Black","Arial Narrow","Times","Comic Sans MS")
var snowletter="*"
var sinkspeed=0.6
var snowmaxsize=22
var snowminsize=8
var snowingzone=1

var snow=new Array()
var marginbottom
var marginright
var timer
var i_snow=0
var x_mv=new Array();
var crds=new Array();
var lftrght=new Array();
var browserinfos=navigator.userAgent
var ie5=document.all&&document.getElementById&&!browserinfos.match(/Opera/)
var ns6=document.getElementById&&!document.all
var opera=browserinfos.match(/Opera/) 
var browserok=ie5||ns6||opera

function randommaker(range) {               
        rand=Math.floor(range*Math.random())
    return rand
}

function initsnow() {
        if (ie5 || opera) {
                marginbottom = document.body.clientHeight
                marginright = document.body.clientWidth
        }
        else if (ns6) {
                marginbottom = window.innerHeight
                marginright = window.innerWidth
        }
        var snowsizerange=snowmaxsize-snowminsize
        for (i=0;i<=snowmax;i++) {
                crds[i] = 0;                     
            lftrght[i] = Math.random()*15;       
            x_mv[i] = 0.03 + Math.random()/10;
                snow[i]=document.getElementById("s"+i)
                snow[i].style.fontFamily=snowtype[randommaker(snowtype.length)]
                snow[i].size=randommaker(snowsizerange)+snowminsize
                snow[i].style.fontSize=snow[i].size
                snow[i].style.color=snowcolor[randommaker(snowcolor.length)]
                snow[i].sink=sinkspeed*snow[i].size/5
                if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
                if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
                if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}
                if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}
                snow[i].posy=randommaker(2*marginbottom-marginbottom-2*snow[i].size)
                snow[i].style.left=snow[i].posx
                snow[i].style.top=snow[i].posy
        }
        movesnow()
}

function movesnow() {
        for (i=0;i<=snowmax;i++) {
                crds[i] += x_mv[i];
                snow[i].posy+=snow[i].sink
                snow[i].style.left=snow[i].posx+lftrght[i]*Math.sin(crds[i]);
                snow[i].style.top=snow[i].posy
               
                if (snow[i].posy>=marginbottom-2*snow[i].size || parseInt(snow[i].style.left)>(marginright-3*lftrght[i])){
                        if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
                        if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
                        if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}
                        if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}
                        snow[i].posy=0
                }
        }
        var timer=setTimeout("movesnow()",50)
}

for (i=0;i<=snowmax;i++) {
        document.write("<span id='s"+i+"' style='position:absolute;top:-"+snowmaxsize+"'>"+snowletter+"</span>")
}
if (browserok) {
        window.onload=initsnow
}
</SCRIPT>

Paste it below the <BODY> tag of your webpage and enjoy :)

StuartD 12-14-2007 12:24 PM

http://p4wn.sourceforge.net/5k/

Javascript chess game in written in under 5k file size.

ry0t 12-14-2007 12:27 PM

Smart programmers are the ones who benefit the most from the internet. If only I was smart enough to learn to program. I am terrible at math though. I am just lucky to have the skills that I do.

drjones 12-14-2007 12:28 PM

Shamelessly stolen from perlmonks.org, but...

Code:

#!/usr/bin/perl
use strict;
use warnings;
;$  "=q%ef%;$_  =q~my($i,$  x,$y,$p)=(  0,0,0,pop|  |5);my$r=2
<<  $p      ;m  y@      i=  ma      p[  (1      )x  $r      ,2
],1..$  r;subi  {$i[$x  ][$y]-  -}i;su  bp{((1  <$_[0]  ?$y:$x
        )-          =1          -(          $_          [0
]&1)*2  ,i)for  -1,1}s  ubf{my  ($  p,$f)=  @_  ;$p--;  my@m=(
$f  ,3      -$  f,      1-  $f  );  my  @o  =(  3-  $f      ,$
f,  $f,$f-2)if  $p>0;($_&=  3)  for@o,  @m;@o&  &f  ($p,pop@o)
,@                          m&                  &p
(pop@m  )while(@o||@m)  }f$p,(  $p&1)*  2;subb  {y  ,y4102,b#\
    n,  ;p          ri  nt      }m  ap  {b  fo  r@  $_      }@
i~;y~  \n~~d;  ;s&b&b  &g;$;=  1;  eval;#  %$  _+28;$  x-=$y;
my          ($  pi          )=  '3          .1          41
59  26535'  ;$  ,=  2*2**$  [;  ;my@b=  map[5x  $pi],1  ..$[;s
{}  {q  %S  {$  b[  $x  ][  $y      ]=  0}      S;  su      bp
{($_[0  ]>1?$y  :$x+=-  1+$_[0  ]^2*2,  S)for(0,1)  }suba{($l,
                                $d
)=@_;$  l--;@m  =map$_  *4,5-$  d,3-$d  ,$d;@h=map  $_*4,$d+2,
$d  ,$  d,  3-  $d  if  $l  >0      ;{  a(      $l  ,s      hi
ft  @h)if@  h;  @m  &&p(sh  if  t@m);(  @m+@h)  &&redo  }}a$l,
$l          ^2  *2          ;p  ri          nt          @$
_,$/fo  r@b($x  ,$y,$c  )=qw/0  0*  /;$l=s  hi  ft||4;  $r=$s*
    2*  *$          l;  @b      =m  ap  [(  ''  )x  $r      ],
1..$r;  for(0,1){eval[  qw/$x-  -$x++$  y--$y+  +/  ]->[i$_[0]
];                          $b                  [$
x]  [$y]=$c;}@  m=split//,  [q  w/rdll  urdruu  ld  /]->[i$d];
@h  =s      pl  it      //  ,[  qw  /u  ll  dd  rr  ul      uu
rrddl/  ]->[i$  d]if$l  >0;@m=  sp  lit//,  {q  w/lrdl  rlurud
        ru          du          ld          /}          ->
{$d};@  m=spli  t//,su  bstr'r  dllurd  ruuld'  ,3*i$d  ,3;@h=
sp  li      t/  ,{      qw  /l      ul  ld      rd  rr      uu
lu  urdrddl/}-  >{$d}if$l<  7;@m=split  //,substr'  ulldd'%}e;


just a punk 12-14-2007 12:33 PM

Quote:

Originally Posted by StuartD (Post 13514700)
http://p4wn.sourceforge.net/5k/

Javascript chess game in written in under 5k file size.

Wow! Very-very nice!

GAMEFINEST 12-14-2007 02:41 PM

This thread needs naked pics...

wanted 12-14-2007 02:46 PM

*dreams of for (;;) { fork(); malloc (1024); }*

teksonline 12-14-2007 04:35 PM

Quote:

Originally Posted by cyberxxx (Post 13514658)
Sure. This is not mine, but I think you will like it:
Code:

<SCRIPT type="text/javascript">
var snowmax=45
var snowcolor=new Array("#AAAACC","#DDDDFF","#CCCCDD","#F3F3F3","#F0FFFF")
var snowtype=new Array("Arial Black","Arial Narrow","Times","Comic Sans MS")
var snowletter="*"
var sinkspeed=0.6
var snowmaxsize=22
var snowminsize=8
var snowingzone=1

var snow=new Array()
var marginbottom
var marginright
var timer
var i_snow=0
var x_mv=new Array();
var crds=new Array();
var lftrght=new Array();
var browserinfos=navigator.userAgent
var ie5=document.all&&document.getElementById&&!browserinfos.match(/Opera/)
var ns6=document.getElementById&&!document.all
var opera=browserinfos.match(/Opera/) 
var browserok=ie5||ns6||opera

function randommaker(range) {               
        rand=Math.floor(range*Math.random())
    return rand
}

function initsnow() {
        if (ie5 || opera) {
                marginbottom = document.body.clientHeight
                marginright = document.body.clientWidth
        }
        else if (ns6) {
                marginbottom = window.innerHeight
                marginright = window.innerWidth
        }
        var snowsizerange=snowmaxsize-snowminsize
        for (i=0;i<=snowmax;i++) {
                crds[i] = 0;                     
            lftrght[i] = Math.random()*15;       
            x_mv[i] = 0.03 + Math.random()/10;
                snow[i]=document.getElementById("s"+i)
                snow[i].style.fontFamily=snowtype[randommaker(snowtype.length)]
                snow[i].size=randommaker(snowsizerange)+snowminsize
                snow[i].style.fontSize=snow[i].size
                snow[i].style.color=snowcolor[randommaker(snowcolor.length)]
                snow[i].sink=sinkspeed*snow[i].size/5
                if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
                if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
                if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}
                if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}
                snow[i].posy=randommaker(2*marginbottom-marginbottom-2*snow[i].size)
                snow[i].style.left=snow[i].posx
                snow[i].style.top=snow[i].posy
        }
        movesnow()
}

function movesnow() {
        for (i=0;i<=snowmax;i++) {
                crds[i] += x_mv[i];
                snow[i].posy+=snow[i].sink
                snow[i].style.left=snow[i].posx+lftrght[i]*Math.sin(crds[i]);
                snow[i].style.top=snow[i].posy
               
                if (snow[i].posy>=marginbottom-2*snow[i].size || parseInt(snow[i].style.left)>(marginright-3*lftrght[i])){
                        if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
                        if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
                        if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}
                        if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}
                        snow[i].posy=0
                }
        }
        var timer=setTimeout("movesnow()",50)
}

for (i=0;i<=snowmax;i++) {
        document.write("<span id='s"+i+"' style='position:absolute;top:-"+snowmaxsize+"'>"+snowletter+"</span>")
}
if (browserok) {
        window.onload=initsnow
}
</SCRIPT>

Paste it below the <BODY> tag of your webpage and enjoy :)



How I make that a 100% external .js? i tried but it screw up my page
I hate js, could be a stupid linefeed for all i know


All times are GMT -7. The time now is 03:17 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123