All Your Programming Language are Belong to Us!

Ok, Call me masochistic. But I'm getting a kick out of this whole AYBABTU phenomenon, and so I figured, "why not?"
(No, don't answer that one)

Actionscript 3 [By: Kurt Grung <kurtgrung :AT: gmail.com>]
        for each (var baseBelongsTo in base){
            if(baseBelongsTo == "you"){
                baseBelongsTo = "us";
                trace("all your base are belong to "+baseBelongsTo+"!");
            }
        } 
            
ANSI BASIC
	10  ON ERROR GOSUB 130
	20  LET I = 0
	30  WHILE I >= 0
	40      LET TEMP$ = ALL_YOUR_BASE$( I )
	40      LET X = INSTR$( TEMP$, BELONG_TO_YOU$ )
	50      IF X > 0 THEN
	60          LET NEW$ = LEFT$( TEMP$, (X - 1) ) & BELONG_TO_US$
	70          LET NEW$ = TEMP$ & RIGHT$( TEMP$, X + LEN( BELONG_TO_YOU$ ) )
	80          LET ALL_YOUR_BASE$( I ) = NEW$
	90      END IF
	100     LET I = I + 1
	110 WEND
	120 END
	130 REM Error handler to indicate we've reached the end of the array.
	140 LET I = -2
	150 RESUME NEXT
            
bash
	for base in * ; do
    	    if [! -O $base] ; then
       	        chown us:us $base
    	    fi
	done
            
C / C++
	for (i = 0; i < (sizeof base / sizeof base_t); i++) {
	    if (base[ i ]->owner == you)
	        base[ i ]->belong_to( us );
	}
            
Common Lisp
	(defun gimme (all_your_base)
	    (if (car all_your_base)
	        ((setf (base-belong_to (car all_your_base)) us)
	         (cons (car all_your_base)
	               (gimme (cdr all_your_base))))
	        all_your_base))

	(gimme all_your_base)
            
CounterStrike (Half-Life) [By: Roland Shine <kubla_kahn99 :AT: hotmail.com>]
	r_allyoubase 1
	mp_arebelongto 1
	cl_you 0
	admin_us 1
	ex_youhavenochance 0.04
	name "make your time"
            
Haskell
	map (\(B belongTo content) -> (B "us" content)) (allyour base) where
	    allyour bases = [(B belongTo content) | (B belongTo content) <- bases, owner == "you"]
            
Java / JavaScript
	for( var i = 0; i < base.length; i++ ) {
	    if (base[ i ].belong_to == you) {
	        base[ i ].belong_to = us;
	    }
	}
            
KEA! Macro
	For base In all_base
	    If base[ "belong_to" ] = you
	        base[ "belong_to" ] = us
	    End
	End
            
LOGO
	TO GIMME :ALL_BASE
	    IF :ALL_BASE = [] STOP
	    LOCAL "BASE FIRST :ALL_BASE
	    IF GPROP "BASE "BELONG_TO = :YOU PPROP "BASE "BELONG_TO :US
	    GIMME BUTFIRST :ALL_BASE
	END

	GIMME :ALL_BASE
            
Pascal
	for base := firstof( all_base ) to lastof( all_base ) do
	begin
	    if all_base[ base ].belong_to = you then
	        all_base[ base ].belong_to := us;
	end;
            
Perl
	for my $base (%all_your_base) {
	    $base{ belong_to } = $us;
	}
            
PHP
	<?php
	    define( "US" (! YOU) );
	    foreach ($allbase as $base) {
	        if ($base[ "belong_to" ] == YOU) {
	            $base[ "belong_to" ] = US;
	        }
	    }
	?>
            
PL/I
	       ON ENDFILE DONE = 1;
	       DONE = 0;
	LOOP1: DO WHILE(DONE = 0);
	       GET DATA (ALLYBASE);
	       IF BELONGTO = YOU THEN BELONGTO = US;
	       END LOOP1;
            
Prolog
        belongto(Base,us) :- belongto(Base,you).
            
Python
	for base in all_your_base:
	    setattr( base, "belong_to", us )
            
REXX
	i = 0
	do until i = base.length
	    if base.i.belong_to = you then base.i.belong_to = us
	    i = i + 1
	end
            
Ruby
        bases.map!{ |b|
            (b.respond_to?( "belong_to" ) and b.belong_to == #you) ? b.belong_to = #us : b
        }
            
Scheme [By: EatTheRich]
	(define all-your-base
	    (lambda are-belong to-us
	        (all-your-base (are-belong to-us ))))

	(all-your-base are-belong to-us)
            
SQL
	UPDATE all_base
	SET    belong_to='us'
	WHERE  belong_to='you';
            
Visual Basic
	For base = LBound( all_base() ) To UBound( all_base() )
	    With all_base( base )
	        .belong_to = IIf( .belong_to = you, me, .belong_to )
	    End With
	Next base
            

Feel free to add your own! Just email me -- seanni :AT: trichotomy.ca
Return Home.