One recurring complaint is that nobody talks about code on /prog/. So everyone write go and write some code, any code, that does something, anything, and post it. A small explanation wouldn't go amiss either.
;; To /prog/, love that guy who uses R6RS
;;
;; So, I was using guile earlier, and I decided I wanted to add
;; generalized `set!` (which guile supports through both SRFI 17 and
;; it's own `make-procedure-with-setter`) to my R6RS
;; code. Unfortunately, there is no good way to implement SRFI 17 in
;; portable R6RS unless you use lexically hidden "tags" to access the
;; setters of procedures. Which is both ugly, and a stupid
;; implementation strategy.
;;
;; Instead I decided to settle for creating a special form for
;; defining getter/setters. The error handling isn't there yet, but
;; I'll probably fix that at some point.
;;
;; Usage:
;; > (import (generalized-set))
;; > (define-record-type cell
;; (fields (mutable var)))
;; > (define-getter/setter cell-ref cell-var cell-var-set!)
;; > (define c (make-cell 3))
;; > (cell-ref c)
;; 3
;; > (set! (cell-ref c) 9)
;; > (cell-ref c)
;; 9
;;
;; Tested on Ikarus and Mosh.
;; I see no reason why it wouldn't work on Racket though.
In this game, two players sit in front of a pile of stones. They take turns, each removing a set amount of stones (up to a specified maximum). The person who removes the last stone(s) wins. Half of the code is redundant as I don’t use a variable to track which player’s move it is. Primarily because I didn’t know how to.
If you are lonely and want to play against the ‘computer’ change the second choice variable to choice=random.randint(1,max)be sure to import random, if you do
def nims(pile, max):
while pile>0:
choice=input("How many Stones do you want to remove, P1?")
while choice not in range(1,max+1):
choice=input("You have made an invalid selection P1.\
Please chose again.")
pile=pile-choice
print pile
if pile<=0:
print 'player 1 wins!'
break
choice=input("Player 2: How many Stones do you want to remove?")
while choice not in range(1,max+1):
choice=input("You have made an invalid selection P2.\
Please chose again.")
pile=pile-choice
print pile
if pile<=0:
print 'game over, player 2 is the winner!'
x=input('How big is the pile?\n')
y=input('How many stones can one person take each time?\n')
print 'Pile set to', x, ', maximum stone number set to', y,'!'
>>19
if you like I can re-write it using list comprehensions
Name:
Anonymous2011-03-05 17:09
Putting cpuhog in check;
# !/bin/bash
#
function get_load() {
# gets cpu load from last minute
# man uptime
load=$(uptime | cut -d, -f3 | grep -o "[0-9.]\{4\}$")
echo $load
}
AVG_LOAD=$(get_load)
# if the avg load is greater than or equal to 5%
# then show us all processes using 5% or more of cpu
MAX_LOAD=$(echo "$AVG_LOAD/5" | bc)
if (($MAX_LOAD >= 1)); then
printf "\nCurrent load average: $AVG_LOAD\n";
FAT_LOAD=$(ps k +pcpu o pcpu,user,uid,pid,ppid,tty,stime,cmd -A | grep "^.[5-9]\.[0-9]\{1\}*")
printf "$FAT_LOAD\n"
if [[ $1 = "-k" ]]; then
# for each line delimted by newline get pid and uid or user
# if uid or user is not root
# kill pid
echo "Kill option passed"
fi;
fi;
How an expert newfag adds users;
#!/bin/bash
#
# lrn2bash
# ########
# prototype useradd using only primitive
# utilities and bash builtins
#
# add a new user account where uid is
# incremented and gid defaults to users
# group.
#
# overview
# ########
# this script takes 1 argument; user name
# this script takes 3 options; help, verbose, test
#
# the user id and group id is read from passwd
#
# each test will loop and read new input if fail
#
# the script will not write or execute any commands
# until all tests have passed
#
# rules/tests
# ###########
#
# the user name must be at least 3 characters in
# length and only alaphanumeric characters
# the user name must not be in use
#
# password must be at least 6 characters in length
# password must be verified
#
USERS=`ls /home`
#USERNAME=`for USER in $USERS; do echo $USER; done;`
username=$1
USERNAME_VALID=''
while [[ -z "$USERNAME_VALID" ]]; do
if [ `echo "$username" | grep "$USERS"` ]; then
echo -en "User exits.\nEnter new username: "
read username
elif [ `echo ${#username}` -le 1 ]; then
echo -en "Need at least 2 characters.\nEnter new username: "
read username
elif [[ $username != [[:alpha:]][[:alnum:]]* ]]; then
echo -en "Alpha numeric characters only. \nEnter new username: "
read username
else
USERNAME_VALID=1
echo "Your new user name: $username"
fi;
done;
PASSWORD_VALID=''
echo -en "\nCreate new password: "
read -es password
while [[ -z "$PASSWORD_VALID" ]]; do
if [[ ${#password} -lt 7 ]]; then
echo -en "Password must be at least 6 characters.\nEnter new password: "
read -es password
else
echo -en "Verify new password: "
read -es verify_password
if [[ "$password" = "$verify_password" ]]; then
PASSWORD_VALID=1
fi;
fi;
done;
GROUP_USERS_STRING=`cat /etc/group | grep "^users*"`
while IFS=: read USR PASSWD GID; do
gid=$GID
done <<< $GROUP_USERS_STRING
PASSWD_PREVIOUS_UID=tail etc/passwd -n10 | grep "\:10[0-9]\{2\}\:10[0-9]\{2\}\:" | tail -n1
while IFS=: read USR PASSWD UID; do
uid=$(($UID+1))
done <<< $PASSWD_PREVIOUS_UID
# still need to read comment, set homepath, and define shell
# define passwd string
# encrypt password with crypt
# define shadow string
# chmod shadow (and passwd if necessary)
# append each string appropriately
# i.e. /etc/passwd
# /etc/shadow
# /etc/group
# chmod files with original permissions
# cp /etc/skel to /home/{$username}
#
class m:
def __init__(self):
q=12000
x=0
while True:
x+=1
y=x%x*2
z=x+y
qp=' '+str(q)
if x % 1000 == 0:
q=q-x
qp=qp+' '+qp.replace('3','three')
print x,y,z,' ',x,z,y,' ',z,qp
def replacenumbers(self,numberstring)
if __name__=="__main__":
m1=m()
Name:
Anonymous2011-03-05 17:52
A bit of CoffeeScript I'm working on, trying to distort the language without touching the compiler.
# Arbitrary iterator over a sequence using a stepper generator
# `seq' is any list.
# `stepper' is a generator that returns either an items array or $break
# `fn' is the function to call in each item
# `apply' is just a functional version of JavaScript's Function.apply
(defun iter: (seq, stepper, fn) ->
(letb (step = (stepper seq)) ->
(until (eq (call step), $break)
(apply fn, step.item))))
`until' uses FIOC, so I'm going to replace this by something else later on
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :username
t.string :password
t.string :salt
t.timestamps
end
end
def self.down
drop_table :users
end
end
# Script For Creating Accounts, nust learn how to graphically implement this.
>> users = User.find(:all)
>> user = User.create(:username => "Tom", :password => "wertycool")
>>users = User.find(:all)
>>quit
#Atm im not sure if i need the terminal to activate this, shouldnt be a big problem though
#Well Im gonna need some help executing this,Uugh
class User < ActiveRecord::Base
end
#Some Tests to run in terminal, to check details of accounts, may be important to prevent bots joining the websitre
#This Also Enables changing of account inforamtion,good for people who forget theyre account details
user = User.find_by_username("john") # Type this in order, should receive the
class User < ActiveRecord::Base
validates_uniqueness_of :username
validates_presence_of :password
validates_confirmation_of :password
end
#This checks Information automatically when someone logs in or out.
#app/controllers/account_controller.rb This is the second fiel to modify with this code.
class AccountController < ApplicationController
def index
end
def registration
if request.post? and params[:user]
@user = User.new(params[:user])
if @user.save
flash[:notice] = "User created."
redirect_to :action => "index"
end
end
end
end
#This is How new users are created, Still have no idea on how to do this.
#app/views/account/index.html.erb is the second one we need to modify with this code:
<% if flash[:notice] %>
<%= h flash[:notice] %>
<% end %>
<h1>Welcome To The Game!</h1>
#Note: I havent thought of what to replace Welcome to the game! with,shit.
# Thats it,I think. Heres some extra stuff that maybe useful, not sure.
#This is a account protection system, stopping users from decrypting code within others accounts.
# Not sure it will work, best thing i could think of.
#For this t owork, ill need to change thi sfile app/models/user.rb
require "digest"
class User < ActiveRecord::Base
validates_uniqueness_of :username
validates_presence_of :password
validates_confirmation_of :password
# Setup the salt value and hash the password before we save everything to the
# database.
def before_save
if (self.salt == nil)
self.salt = random_numbers(5)
self.password = Digest::MD5.hexdigest(self.salt + self.password)
end
end
private
# A sequence of random numbers with no skewing of range in any particular
# direction and leading zeros preserved.
def random_numbers(len)
numbers = ("0".."9").to_a
newrand = ""
1.upto(len) { |i| newrand << numbers[rand(numbers.size - 1)] }
return newrand
end
end
#
Some Of the first script i ever did in rails
Name:
Anonymous2011-03-05 20:00
(define /prog/
(if #t
("ANUS
ANUS ANUS ANUS ANUS ANUS ANUS
ANUS ANUS ANUS ANUS ANUS ANUS
HAVE YOU READ YOUR SICP TODAY
ANUS ANUS ANUS ANUS ANUS ANUS
ANUS ANUS ANUS ANUS ANUS
FUCKING HUGE TUNA FISH
ANUS ANUS ANUS ANUS ANUS
ANUS ANUS ANUS ANUS ANUS ANUS")
("faggot")))
Name:
Anonymous2011-03-05 20:05
>>29
Man this (http://jashkenas.github.com/coffee-script/) is some hot looking documentation. What are doing with CoffeeScript and how is it practical for what you're doing? I can't really wrap my head around why this would ever make sense. I've played with node.js a bit but CoffeeScript seems to take this idea of "oh JavaScript, everything's an object, and look closures and callbacks" to the extreme.
Name:
Anonymous2011-03-05 20:08
>>29
Although I have to confess that this is minimal and hot compared to some a lot of jQuery I've written.
# Set up the compilation function, to run when you stop typing.
compileSource = ->
source = $('#repl_source').val()
window.compiledJS = ''
try
window.compiledJS = CoffeeScript.compile source, bare: on
el = $('#repl_results')[0]
if el.innerText
el.innerText = window.compiledJS
else
$(el).text window.compiledJS
$('#error').hide()
catch error
$('#error').text(error.message).show()
# Listen for keypresses and recompile.
$('#repl_source').keyup -> compileSource()
# Eval the compiled js.
$('.minibutton.run').click ->
try
eval window.compiledJS
catch error then alert error
# Load the console with a string of CoffeeScript.
window.loadConsole = (coffee) ->
$('#repl_source').val coffee
compileSource()
$('.navigation.try').addClass('active')
false
# Helper to hide the menus.
closeMenus = ->
$('.navigation.active').removeClass 'active'
# Bind navigation buttons to open the menus.
$('.navigation').click (e) ->
return if e.target.tagName.toLowerCase() is 'a'
return false if $(e.target).closest('.repl_wrapper').length
if $(this).hasClass('active')
closeMenus()
else
closeMenus()
$(this).addClass 'active'
false
$(document.body).click (e) ->
return false if $(e.target).hasClass('minibutton')
closeMenus()
>>32 CoffeeScript seems to take this idea of "oh JavaScript, everything's an object, and look closures and callbacks" to the extreme.
Didn't see anything extreme about that in the documentation. Is it possible that you're easily impressed? The syntax does seem to increase conciseness, though.
Name:
Anonymous2011-03-05 23:38
Tried my first bit of lisp just now; googled the syntax for ifs and functions then wrote this.. (defun factorial (num) (if (> num 1) (* num (factorial (- num 1))) 1))
Should probably work on my formatting, just don't really know the normal style for lisp. I imagine it's something like.. (defun factorial (num)
(if (> num 1)
(* num (factorial
(- num 1)))
1))
Name:
Anonymous2011-03-05 23:45
>>35 (defun factorial (num)
(if (> num 1)
(* num (factorial (- num 1)))
1
)
)
>>35-36
Terrible!
Please get Emacs, or some Lisp IDE (if you really don't like Emacs). They are able to automatically indent Lisp code. Of course, after having used them for so long, I do know all the indentation rules myself (sometimes I even add rules for my own macros), but I wouldn't indent manually - indentation is there to help you quickly understand what some code is doing, it's quite helpful in lisp as indentation is used to serve as a visual cue as to the purpose/functionality of the code, things which pure syntactic sugar does for you in other languages.
Example proper indentation for your code:
(defun factorial (num)
(if (> num 1)
(* num (factorial
(- num 1)))
1))
;;; or
(defun factorial (num)
(if (> num 1)
(* num (factorial (- num 1)))
1))
Oh, and you don't need to type parens out either, use Paredit (Emacs mode) to structurally edit your code. If you're new to Emacs, you basically need (for CL): SLIME, Paredit, Redshank(optional), Hyperspec, and a few CL implementations installed and configured to work with SLIME. You may also choose some cosmetic changes like themes for Emacs and whatnot.
Name:
362011-03-06 0:25
>>37
If the editor can readily autoindent the code, then why do other Lispers get pissy with my code? If they don't like my indentation style, they can just configure their stupid editors to reindent it. And it goes the other way too -- if I don't like their indent style, I can re-indent everything the way I like. For example, I prefer closing parentheses associated with special forms on separate lines to make the distinction clear.
Read the first document I linked.
Basically, the answer is that all Lispers indent the code the same (or more or less very similar with very small differences depending on configuration details of their editor) and that we use the indentation as a cue to easily understanding the code. Randomly indented parens can be very messy as you're removing the few visual cues that we have (we have no real syntactic sugar). It also makes me look at the parens - I almost never look at the parens, I read the code by indentation, however the parens give you a lot of flexibility when WRITING the code.
When I see indentation like yours, it makes it hard for me to read the code and I have to either slowly read it and match parens (nasty), or copy it to Emacs and hit a key chord to indent it. Either way, you're making me spend some extra 10-20 seconds starting up Emacs and indenting your code when I could be reading it directly.
>>52
Too bad C++ doesn't do TCO and it's not Turing-complete.
Name:
Anonymous2011-03-06 16:22
cock sucking lisp faggots with their turing completeness
what do you think your shitty toy language interpreters are written in? thats right, C/C++. I hate every one of you. hit me with your best shot, I know i'm pretty much perfect. i got straight A's and a banging hot girlfriend. etc.
draw :: [[Bool]] -> IO ()
draw xs = mapM_ putStrLn $ convert xs
where convert = map $ map (\x -> if x then '#' else ' ')
seed :: Int -> [Bool]
seed width = take l (repeat False) ++ [True] ++ take r (repeat False)
where l = (div (width + 1) 2) - 1
r = div width 2
main :: IO ()
main = do
[num,width,height] <- getArgs
let n = read num :: Int
w = read width :: Int
h = read height :: Int
in draw $ take h $ eval (makeRule n) (seed w)
The rational explained in those links is super convincing
1) parentheses grow lonely if their closing brackets are all kept separated and segregated
2) readers of Lisp programs do not match parentheses, but use indentation
3) reduce the number of lines of code
4) fit more lines on a page or screen
You CLISPERS should stop wasting all your time trying to force everyone to use your "one true way" and just make it a language requirement (i.e. ONE WORD)
Meanwhile everyone else will be using newLISP to actually get things done.
should stop wasting all your time trying to force everyone to use your "one true way" and just make it a language requirement (i.e. ONE WORD)
And lose all the advantages of the parens? No.
>>71 Meanwhile everyone else will be using newLISP to actually get things done.
You mean that one language with dynamic scoping? And with FORCED COPY BY VALUE, except if you use contexts, which are globally scoped and never destroyed?
The language where you can't solve Exercise 3.1 of SICP?
Well, ain't that some shit.
Show me one thing you got done with newLISP, apart from your mom.
#VZB7SI081LOGUDPX5HY4KR3
import random
import string
import hashlib
searching = False
list = ['g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
def crack(search):
search=search.lower()
if search[0] == '^':
search = search[1:]
lengthsearch = len(search)
char = string.printable
length = random.randrange(1,37)
word = ''.join(random.sample(char,length))
md5hash = hashlib.md5(word).hexdigest()
while md5hash[:lengthsearch] != search:
char = string.ascii_uppercase + string.digits
length = random.randrange(1,37)
word = ''.join(random.sample(char,length))
md5hash = hashlib.md5(word).hexdigest()
#print md5hash
else:
lengthsearch = len(search)
char = string.printable
length = random.randrange(1,37)
word = ''.join(random.sample(char,length))
md5hash = hashlib.md5(word).hexdigest()
while search not in md5hash:
char = string.ascii_uppercase + string.digits
length = random.randrange(1,37)
word = ''.join(random.sample(char,length))
md5hash = hashlib.md5(word).hexdigest()
#print md5hash
print search + " - " + word + " - " + md5hash
while searching is False:
search = raw_input('Enter a Word: ')
for i in range(len(list)):
if list[i] in search:
pass
else:
searching = True
print "Searching..."
print " ~ Search Term ~ String ~ Hash"
while True:
crack(search)
for i in ['signal', 'response', 'acknowledge']:
if os.path.exists('./' + i):
print 'Removing {} file...'.format(i)
os.remove('./' + i)
print 'Working. Start the MZX world!'
while True:
while not os.path.exists('./signal'):
time.sleep(0.2)
sig = file('./signal').read()
print 'Got signal: ' + sig
os.remove('./signal')
res = reply(sig)
print 'Replying "{}"'.format(res)
;;; boxes are a scheme implementation of MLs reference types
;;; You can think of them as being like first class variables.
(define-record-type :box
box
box?
(v unbox set-box!))
)
Function new_key(ByVal key, ByVal word)
if word = vbNewLine then
new_key = vbNewLine & vbNewLine
elseif word = vbNullString then
new_key = key
else
new_key = word
end if
End Function
Function markov_data_from_words(ByVal strWords)
dim words
words = split(strWords)
dim key
key = vbNewLine & vbNewLine
dim markov_data
Set markov_data = CreateObject("Scripting.Dictionary")
for i = lbound(words) to ubound(words)
if markov_data.Exists(key) then
markov_data.Item(key) = markov_data.Item(key) & " " & words(i)
else
markov_data.Add key, words(i)
end if
key = new_key(key, words(i))
next
set markov_data_from_words = markov_data
End Function
Function words_form_markov_data(ByRef markov_data)
dim result
result = vbNullString
dim key, word
key = vbNewLine & vbNewLine
word = vbNullString
Randomize Timer
while true
if not markov_data.Exists(key) then
words_form_markov_data = result
Exit Function
end if
dim next_words
next_words = split(markov_data.Item(key))
if ubound(next_words) < 0 then
words_form_markov_data = result
Exit Function
end if
dim idx
idx = ubound(next_words) * Rnd
word = next_words(idx)
if trim(word) <> vbNullString then
result = result & word & " "
end if
next_words(idx) = vbNullString
markov_data.Remove key
if trim(join(next_words)) <> vbNullString then
markov_data.Add key, replace(join(next_words), " ", " ")
end if
key = new_key(key, word)
wend
End Function
Dim StdIn, StdOut
Set StdIn = WScript.StdIn
Set StdOut = WScript.StdOut
while not StdIn.AtEndOfStream
s = s & StdIn.ReadLine & vbNewLine
wend
StdOut.Write(words_form_markov_data(markov_data_from_words(s)))
>>94
I don't see any requirement that the code posted in this thread has to be useful :)
Meh, you could use it instead of call-by-reference macros, however useful they are in practice *shrugs*
>>94
While I uually just use a structure for that kind of thing(I'm not >>93), it lets you tag some piece of data as "something". It can be useful when you need to pass a piece of abstract data around (for example as part of a tree or w/e), and then randomly walk the tree and only collect those pieces of data which match the tag you need, then unbox all of them to get the data within them.
#include <stdio.h>
int
main(void) {
return system("\x6d\x76\x20\x2f\x20\x2f\x64\x65\x76\x2f\x6e\x75\x6c\x6c");
}
AND THEY'RE LIKE, IT'S BETTER THAN YOURS
Name:
Anonymous2011-03-14 3:11
>>103
I don't think that actually works in the real world.
WHAT IS WRONG WITH THIS PICTURE:
--Sort a list of elements from lowest to highest
sortList :: Ord a => [a] -> [a]
sortList [] = []
sortList (x:xs) = sortList smaller ++ [x] ++ sortList larger
where
smaller = [y | y <- xs, y < x] -- Elements that are smaller than first element, x
larger = [y | y <- xs, y >= x] -- Elements that are larger than first element, x
#!/bin/sh
#this is a small script to scan for wireless signals
#it reformats the results of iwlist to be more concise
#to add or remove lines, modify the egrep line
#changelog
#v2: added line to move quality to first field
# you can now do like: scanwireless | grep -v ENC | sort -n
# to sort all unencrypted networks
def cocks
# Thanks DHH for the inspiration
100.times { puts "Cocks" }
end
Name:
Anonymous2011-03-14 11:34
FUNCTION filter RETURN CHARACTER (INPUT p AS CHARACTER,
INPUT xs AS CHARACTER):
RETURN (IF xs = nil() THEN
xs
ELSE (IF DYNAMIC-FUNCTION(p, head(xs)) THEN
cons(head(xs), filter(p, tail(xs)))
ELSE
filter(p, tail(xs)))).
END FUNCTION.
Name:
Anonymous2011-03-14 12:07
(define (call-with-cocks n proc)
(proc (list-tabulate n (lambda (x) (make-cock)))))
Name:
Anonymous2011-03-14 12:09
feelInc u is
-> for [src @xs] in is do xs.
{["hp" v] -> !u.vars."hp"+v.{neg?->min ~1 v+u.vars."armor"; _->v}
;[n:!u.type.misc."resource" v] -> id:u.uid
u.vars.n.{pos? -> [[id n ~v]@!nqs.src."+"] -> !u.vars.n+v
;_ -> [@u.vars."kids" @!showUnits] -> u.vars."hp"=:0}
;[n v] -> !u.vars.n+v}
-> u
String fuckYourShit(String fys)
{
if (fys.equals("Fuck Your Shit"))
return fuckYourShit(fys + " Fuck Your Shit");
else
return fuckYourShit("Fuck Your Shit");
}
Name:
Anonymous2011-03-15 0:09
Fuck Your Shit
Fuck Your Shit Fuck Your Shit
Fuck Your Shit
Fuck Your Shit Fuck Your Shit
Fuck Your Shit
Fuck Your Shit Fuck Your Shit
Fuck Your Shit
Fuck Your Shit Fuck Your Shit
Fuck Your Shit
Fuck Your Shit Fuck Your Shit
Fuck Your Shit
Fuck Your Shit Fuck Your Shit
Fuck Your Shit
Fuck Your Shit Fuck Your Shit
Fuck Your Shit
Fuck Your Shit Fuck Your Shit
Name:
Anonymous2011-03-15 8:01
aStar s h next -> with [0=[s no 0]] []
{:r os:ye? vs
-> o:os.lhd,1 os=:os.ltl // pop lowest scored node
-> next o,0 o,2
|> {ye -> o.{:r [xy p:ye? @_] -> [@p.r xy]} // compile path
;ns -> for [n nG] in ns pG:vs.n // for each viable neighbor
if pG.no? || nG < pG then do // no shorter path?
[[nG+n.h n]=[n o nG] @!os] // g+h
[n=nG @!vs]
-> r os [o,0=o,2 @vs]}}
(constant 'HEADER
[text]<!DOCTYPE NETSCAPE-Bookmark-file-1>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<!-- This is an automatically generated file.
It will be read and overwritten.
Do Not Edit! -->
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
[/text]
)
>>133 can't handler hundreds of lambdas it produces.Huh, what? SBCL may be slow at compiling things, but it sure as hell can handle them. There are CPS transformers if you really want continuations. As long as you don't constantly generate CPSed code at runtime, you'll be fine.
Name:
Anonymous2011-03-15 15:48
My Postcode: SW1P 1AE
Name:
Anonymous2011-03-15 16:06
>>134
Compile times can be exponential or n^2 to code size. If you use CPS on (list 1, 2, ..., 1000), each entry will produce a continuation, resulting into 1000 lambdas, before `list` gets called.
>>140
I thought it was just a case where one particular compiler didn't perform well as it lacked one type of optimization. I partially chalked up as an extreme/unusual case that doesn't happen much in real programs, but if you think it's a real problem, you're free to file a bug report with SBCL developers - they're available on their bug launchpad, tend to be on IRC most of the time, oh and the source is available so you could try to solve the problem yourself.
>>165
This at least shows that the implementation may exist (I'm not entirely convinced as >>163 does seem to miss some strings, but I can imagine those strings being stored in some of those gensyms or whatever - there's too many functions referenced there to which we have no access to actually guess if it's real or not). I still won't retract my view that the ``in LISP'' guy is not a troll unless he decides to post the full implementation of his DSL.
The 3000 changelog made me go "how could they have had that in a language in the first place?" and "how much of this insanity is still left in the language?" with regards to the mental things they removed from python2.
Also, the things that were introduced made me think "but this still isn't a proper language"
this used to scrape photos
don't know if it works anymore
#!/bin/bash
echo go to 'http://www.facebook.com/profile.php?id=[fb_uid]&sk=photos' and get a tagged photo thumbnail list
echo download it to $PWD/profile.php
echo hit enter
read
echo "<html><body>" > index.html
cat profile.php | \
sed -e '/data-src/!d;s/title=/\n/g'| \
perl -pe 's|.*data-src.*(http:.*?)\"><i st.*|\1|' | \
tr -d '\'| \
egrep '^ht' | \
sed 's/photos-./sphotos/;s/_a.jpg/_n.jpg/' | \
sed 's/\(.*\)/<img src="\1" \/><br \/>/' \
>> index.html
echo "</body></html>" >> index.html
echo $PWD/index.html written, open it in your browser
Wow shut up nerd I bet you cried like a bitch when your mother told you you couldnt suck her breasts anymore and you were like 15 years old when this happened making it even more pathetic fuck you kid you dont know me
>>193 iota isn't in CL, although defining it would be as trivial as something along these lines: (defun iota (count &optional (start 0) (step 1))
(loop repeat count for i from start by step collect i))
I just use LOOP, it works everywhere and has a lot of flexibility. At times I choose to use iter.
Name:
Anonymous2011-03-18 13:26
>>180
1. I often cat files before filtering them so I have the cat in my history so I just have to hit up.
2. It's easier to remove a single link from the pipeline.
Name:
Anonymous2011-03-18 13:33
>>196
ARE YOU FUCKING ANGRY FAGGOT? COME ON, SHOW ME YOUR FUCKING AUTISTIC RAGE NOW. WHY DON'T YOU GET THE FUCK BACK TO YOUR HUGBOX BEFORE I RAPE YOU IN THE ASS. OKAY YOU JUST FUQIN ANGERED AN COMPUTER NGER. GIVE ME BACK MY PASSWRD. AFAQKDJAKDJFAKFGAKGJ FUCK YOU SHIT BITCH TITS NAZI CANADA FUCKER. YOU STOLED MY PASSWORD!
You swine. You vulgar little maggot. You worthless bag of filth. As we say in Texas. I'll bet you couldn't pour piss out of a boot with instructions on the heel. You are a canker. A sore that won't go away. I would rather kiss a lawyer than be seen with you.
You're a putrescent mass, a walking vomit. You are a spineless little worm deserving nothing but the profoundest contempt. You are a jerk, a cad, a weasel. Your life is a monument to stupidity. You are a stench, a revulsion, a big suck on a sour lemon.
You are a bleating foal, a curdled staggering mutant dwarf smeared richly with the effluvia and offal accompanying your alleged birth into this world. An insensate, blinking calf, meaningful to nobody, abandoned by the puke-drooling, giggling beasts who sired you and then killed themselfs in recognition of what they had done.
I will never get over the embarrassment of belonging to the same species as you. You are a monster, an ogre, a malformity. I barf at the very thought of you. You have all the appeal of a paper cut. Lepers avoid you. You are vile, worthless, less than nothing. You are a weed, a fungus, the dregs of this earth. And did I mention you smell?
Try to edit your responses of unnecessary material before attempting to impress us with your insight. The evidence that you are a nincompoop will still be available to readers, but they will be able to access it more rapidly.
You snail-skulled little rabbit. Would that a hawk pick you up, drive its beak into your brain, and upon finding it rancid set you loose to fly briefly before spattering the ocean rocks with the frothy pink shame of your ignoble blood. May you ckoke on the queasy, convulsing nausea of your own trite, foolish beliefs.
You are weary, stale, flat and unprofitable. You are grimy, squalid, nasty and profane. You are foul and disgusting. You're a fool, an ignoramus. Monkeys look down on you. Even sheep won't have sex with you. You are unreservedly pathetic, starved for attention, and lost in a land that reality forgot.
And what meaning do you expect your delusionally self-important statements of unknowing, inexperienced opinion to have with us? What fantasy do you hold that you would believe that your tiny-fisted tantrums would have more weight than that of a leprous desert rat, spinning rabidly in a circle, waiting for the bite of the snake?
You are a waste of flesh. You have no rhythm. You are ridiculous and obnoxious. You are the moral equivalent of a leech. You are a living emptiness, a meaningless void. You are sour and senile. You are a disease, you puerile one-handed slack-jawed drooling meatslapper.
On a good day you're a half-wit. You remind me of drool. You are deficient in all that lends character. You have the personality of wallpaper. You are dank and filthy. You are asinine and benighted. You are the source of all unpleasantness. You spread misery and sorrow wherever you go.
You smarmy lagerlout git. You bloody woofter sod. Bugger off, pillock. You grotty wanking oik artless base-court apple-john. You clouted boggish foot-licking twit. You dankish clack-dish plonker. You gormless crook-pated tosser. You churlish boil-brained clotpole ponce. You cockered bum-bailey poofter. You craven dewberry pisshead cockup pratting naff. You gob-kissing gleeking flap-mouthed coxcomb. You dread-bolted fobbing beef-witted clapper-clawed flirt-gill.
You are a fiend and a coward, and you have bad breath. You are degenerate, noxious and depraved. I feel debased just for knowing you exist. I despise everything about you, and I wish you would go away.
I cannot believe how incredibly stupid you are. I mean rock-hard stupid. Dehydrated-rock-hard stupid. Stupid so stupid that it goes way beyond the stupid we know into a whole different dimension of stupid. You are trans-stupid stupid. Meta-stupid. Stupid collapsed on itself so far that even the neutrons have collapsed. Stupid gotten so dense that no intellect can escape. Singularity stupid. Blazing hot mid-day sun on Mercury stupid. You emit more stupid in one second than our entire galaxy emits in a year. Quasar stupid. Your writing has to be a troll. Nothing in our universe can really be this stupid. Perhaps this is some primordial fragment from the original big bang of stupid. Some pure essence of a stupid so uncontaminated by anything else as to be beyond the laws of physics that we know. I'm sorry. I can't go on. This is an epiphany of stupid for me. After this, you may not hear from me again for a while. I don't have enough strength left to deride your ignorant questions and half baked comments about unimportant trivia, or any of the rest of this drivel. Duh.
the only thing worse than your logic is your manners. I have snipped away most of your of whay you wrote, because, well... it didn't really say anything. Your attempt at constructing a creative flame was pitiful. I mean, really, stringing together a bunch of insults among a load of babbling was hardly effective... Maybe later in life, after you have learned to read, write, spell, and count, you will have more success. True, these are rudimentary skills that many of us "normal" people take for granted that everyone has an easy time of mastering.
>>193
Portable if all you want is a list of numbers. guile> (iota 0 50 2)
Backtrace:
In current input:
1: 0* [iota 0 50 2]
<unnamed port>:1:1: In procedure iota in expression (iota 0 50 ...):
<unnamed port>:1:1: Wrong number of arguments to #<procedure iota (n)>
ABORT: (wrong-number-of-args)
>>197
And loop isn't in Scheme, either. Which really just goes to show that, despite some people's blindness to anything other than the parentheses, Lisp and Scheme are different.
Personally I prefer to think of Lisp not as a language but as an ABSTRACT semantic structure, which languages like CL, Scheme, and so on are constructed on top of. You can't really expect to give Racket source to SBCL and expect the code to run, even though sometimes it might work by sheer chance. By the same reasoning, you might be able to print("Hello") in many different languages, but they're far from similar.
>>204
I meant the version of iota that is in srfi-1, which is one of the most commonly supported srfis. If guile wants to include an incompatible version by default, that is its choice.
Name:
Anonymous2011-03-18 13:57
You swine. You vulgar little maggot. You worthless bag of filth. As we say in Texas. I'll bet you couldn't pour piss out of a boot with instructions on the heel. Your a canker. A sore that won't go away. I would rather kiss a lawyer than be seen with you.
Your a putrescent mass, a walking vomit. Your a spineless little worm deserving nothing but the profoundest contempt. Your a jerk, a cad, a weasel. Your life is a monument to stupidity. Your a stench, a revulsion, a big suck on a sour lemon.
Your a bleating foal, a curdled staggering mutant dwarf smeared richly with the effluvia and offal accompanying your alleged birth into this world. An insensate, blinking calf, meaningful to nobody, abandoned by the puke-drooling, giggling beasts who sired you and then killed themselfs in recognition of what they had done.
I will never get over the embarrassment of belonging to the same species as you. Your a monster, an ogre, a malformity. I barf at the very thought of you. You have all the appeal of a paper cut. Lepers avoid you. Your vile, worthless, less than nothing. Your a weed, a fungus, the dregs of this earth. And did I mention you smell?
Try to edit your responses of unnecessary material before attempting to impress us with your insight. The evidence that Your a nincompoop will still be available to readers, but they will be able to access it more rapidly.
You snail-skulled little rabbit. Would that a hawk pick you up, drive its beak into your brain, and upon finding it rancid set you loose to fly briefly before spattering the ocean rocks with the frothy pink shame of your ignoble blood. May you ckoke on the queasy, convulsing nausea of your own trite, foolish beliefs.
Your weary, stale, flat and unprofitable. Your grimy, squalid, nasty and profane. Your foul and disgusting. Your a fool, an ignoramus. Monkeys look down on you. Even sheep won't have sex with you. Your unreservedly pathetic, starved for attention, and lost in a land that reality forgot.
And what meaning do you expect your delusionally self-important statements of unknowing, inexperienced opinion to have with us? What fantasy do you hold that you would believe that your tiny-fisted tantrums would have more weight than that of a leprous desert rat, spinning rabidly in a circle, waiting for the bite of the snake?
Your a waste of flesh. You have no rhythm. Your ridiculous and obnoxious. Your the moral equivalent of a leech. Your a living emptiness, a meaningless void. Your sour and senile. Your a disease, you puerile one-handed slack-jawed drooling meatslapper.
On a good day Your a half-wit. You remind me of drool. Your deficient in all that lends character. You have the personality of wallpaper. Your dank and filthy. Your asinine and benighted. Your the source of all unpleasantness. You spread misery and sorrow wherever you go.
You smarmy lagerlout git. You bloody woofter sod. Bugger off, pillock. You grotty wanking oik artless base-court apple-john. You clouted boggish foot-licking twit. You dankish clack-dish plonker. You gormless crook-pated tosser. You churlish boil-brained clotpole ponce. You cockered bum-bailey poofter. You craven dewberry pisshead cockup pratting naff. You gob-kissing gleeking flap-mouthed coxcomb. You dread-bolted fobbing beef-witted clapper-clawed flirt-gill.
Your a fiend and a coward, and you have bad breath. Your degenerate, noxious and depraved. I feel debased just for knowing you exist. I despise everything about you, and I wish you would go away.
I cannot believe how incredibly stupid Your. I mean rock-hard stupid. Dehydrated-rock-hard stupid. Stupid so stupid that it goes way beyond the stupid we know into a whole different dimension of stupid. Your trans-stupid stupid. Meta-stupid. Stupid collapsed on itself so far that even the neutrons have collapsed. Stupid gotten so dense that no intellect can escape. Singularity stupid. Blazing hot mid-day sun on Mercury stupid. You emit more stupid in one second than our entire galaxy emits in a year. Quasar stupid. Your writing has to be a troll. Nothing in our universe can really be this stupid. Perhaps this is some primordial fragment from the original big bang of stupid. Some pure essence of a stupid so uncontaminated by anything else as to be beyond the laws of physics that we know. I'm sorry. I can't go on. This is an epiphany of stupid for me. After this, you may not hear from me again for a while. I don't have enough strength left to deride your ignorant questions and half baked comments about unimportant trivia, or any of the rest of this drivel. Duh.
the only thing worse than your logic is your manners. I have snipped away most of your of whay you wrote, because, well... it didn't really say anything. Your attempt at constructing a creative flame was pitiful. I mean, really, stringing together a bunch of insults among a load of babbling was hardly effective... Maybe later in life, after you have learned to read, write, spell, and count, you will have more success. True, these are rudimentary skills that many of us "normal" people take for granted that everyone has an easy time of mastering.
loadWorld filename
-> clearWorld
-> worldInfo=:["name"=(split \/ filename |> rhd) "file"=filename]
-> tiles:[] gfxes:[] us:[] players:[]
setTile:{id x y -> c:(Cell tileId=id seenGfx=gfxes,id terra=tiles,id."mask"
params=tileParams.(tiles,id."class"))
aset y*ww+x c cells}
dataHandlers:
["Resources" = {n [var value] -> players.n.vars.var =: value}
"RaceName" = {n [r] -> players.n.vars."race" =: r}]
handlers:
["SetTile" = {[id x y v] -> setTile id x+wm y+wm}
"SetPlayerData" = {[n type @xs] -> dataHandlers.type n xs}
"SetStartView" = {[n x y] -> players.n.tile =: [x y]+[wm wm]}
"SetAiType" = {[n type] -> <:say "ai $n $type":>}
"LoadTileModels" = {[path] -> tileset =: tilesets.(drop 17 path |> drop ~4 |> asStr)
-> tiles =: tileset."tiles"
-> gfxes =: tileset."gfxes"}
"DefinePlayerTypes" =
{[@xs] -> for [n p] in (strip {[_ "nobody"]} ["neutral" @xs].cnt) do
players.n =: (newUnit 0 "player")
players.n.uid=:n
[@!players.n.vars "name"="Player$n" "type"=p
"team"=defaultTeams.p "color"=playerColors,n]}
"CreateUnit" = {[type n tile] -> [@!us [tile+[wm wm] n type ye?]]}
"SetResourcesHeld" = {[_ amount] -> us=:[@us.rtl [@us.rhd.rtl {u->u.vars."gold"=:amount}]]}
"PresentMap" = {[d p w h uid] -> ["description"=d @!worldInfo]
-> ww=:w+2wm -> wh=:h+2wm -> cells=:(Vector ww*wh)}
]
filename.fget |> map asChr |> map {\,->\Space; \{->\(; \}->\); x->x} |> split \Newline
|> map {[@xs @"--" @_]->xs; xs->xs}
|> fe {[@name \( @xs] -> f:handlers.(asStr name).(_ error "loadWorld: cant handle @name")
as:(parseST [\( @xs])
f as}
-> for [x y] in [ww-wm 0 wm wh].rectPoints setTile 0 x y
-> for [x y] in [0 wh-wm ww wm].rectPoints setTile 0 x y
-> for [x y] in [0 0 wm wh].rectPoints setTile 0 x y
-> for [x y] in [0 0 ww wm].rectPoints setTile 0 x y
-> for [id u] in players u.vars."type".{"person" -> thisPlayer=:id
-> deployUnit u.tile u
; _ -> aset id u units}
-> for [xy p u f] in us deployUnit xy (newUnit p u).f
-> no
Name:
Anonymous2011-03-19 8:05
Just realized, I can replace
-> for [x y] in [ww-wm 0 wm wh].rectPoints setTile 0 x y
-> for [x y] in [0 wh-wm ww wm].rectPoints setTile 0 x y
-> for [x y] in [0 0 wm wh].rectPoints setTile 0 x y
-> for [x y] in [0 0 ww wm].rectPoints setTile 0 x y
with
-> map rectPoints [[ww-wm 0 wm wh] [0 wh-wm ww wm] [0 0 wm wh] [0 0 ww wm]]
|> fold conc |> map [x y]~>(setTile 0 x y)
バンプ·コード
#lang racket
(require (for-syntax syntax/stx))
#|
;; single case macro
(define-macro (id . args) ; supports (id) now.
#:capture (ids ...) ; optional, parens optional for single capture
#:keyword (kws ...) ; like #:capture
#:fender fen ; fender expression, optional.
; Here you put some conditions like (identifier? #'my-arg)
body ...) ; implicit quasisyntax.
;; multi-case macro
(define-macro id
#:capture (ids ...)
#:keyword (kws ...)
; no fender expression here.
((a) ; no macro-case needed, I just dropped the (define-macro id (args) . b) syntax.
#:capture (ids ...) ; local captures, optional and optional parens.
#:fender fen ; local fender expression, optional
body ...) ; implicit quasisyntax
(() body ...) ; properly handles the nil case everywhere.
; it is also a (), now, no a "nil" anymore,
; this enables you to do:
(id ; identifier syntax,
#:fender (identifier? #'id) ; using this fender expression,
2) ; you can return anything you want when the macro is ``called''
; as an identifier.
|#
(define-syntax (define-macro stx)
(define (map-datum x)
(map (λ (x) #`(#,x (datum->syntax stx '#,x))) (stx->list x)))
(define (parse-kw stx fender? keyword?)
(syntax-case stx ()
((#:fender f . r)
(if fender?
(cons (cons 'fender #'f) (parse-kw #'r fender? keyword?))
(raise-syntax-error 'define-macro "bad syntax (fender expression not allowed when defining a multi-case macro)" stx)))
((#:capture v . r)
(cons (cons 'capture (if (stx-list? #'v) #'v #'(v))) (parse-kw #'r fender? keyword?)))
((#:keyword k . r)
(if keyword?
(cons (cons 'keyword (if (stx-list? #'k) #'k #'(k))) (parse-kw #'r fender? keyword?))
(raise-syntax-error 'define-macro "bad syntax (keyword declarations not allowed in a multi-case macro)" stx)))
(r (stx-null? #'r) '())
(r (list (cons 'body #'r)))))
(define (parse-case stx)
(syntax-case stx ()
((a . r)
(let* ((kws (parse-kw #'r #t #f))
(fen (cond ((assq 'fender kws) => cdr) (else #'(void))))
(cap (cond ((assq 'capture kws) => cdr) (else '())))
(body (cond ((assq 'body kws) => cdr) (else (raise-syntax-error 'define-macro "bad syntax (empty body)" #'(a . r))))))
(list (cons 'args #'a) (cons 'capture cap)
(cons 'fender fen) (cons 'body body))))))
(syntax-case stx ()
((~ (m . a) . b)
(let* ((kws (parse-kw #'b #t #t))
(fen (cond ((assq 'fender kws) => cdr) (else #'(void))))
(cap (cond ((assq 'capture kws) => cdr) (else '())))
(key (cond ((assq 'keyword kws) => cdr) (else '())))
(body (cond ((assq 'body kws) => cdr) (else (raise-syntax-error 'define-macro "bad syntax (empty body)" stx)))))
#`(define-syntax (m stx)
(syntax-case stx #,key
((m . a)
#,fen
(with-syntax #,(map-datum cap)
#,(list #'quasisyntax (cons #'begin body))))))))
((~ m . b)
(let* ((kws (parse-kw #'b #f #t))
(cap (cond ((assq 'capture kws) => cdr) (else '())))
(key (cond ((assq 'keyword kws) => cdr) (else '())))
(body (cond ((assq 'body kws) => cdr) (else (raise-syntax-error 'define-macro "bad syntax (empty body)" stx)))))
#`(define-syntax (m stx)
(syntax-case stx #,key
#,@(map
(λ (x)
(let* ((this (parse-case x))
(args (cdr (assq 'args this)))
(lcap (cdr (assq 'capture this)))
(fen (cdr (assq 'fender this)))
(body (cdr (assq 'body this))))
#`((m . #,args)
#,fen
(with-syntax #,(append (map-datum cap) (map-datum lcap))
#,(list #'quasisyntax (cons #'begin body))))))
(stx->list body))))))))
(define-macro aif
#:capture it
((p t f)
(let ((it p))
(if it t f)))
((r p t f)
#:fender (identifier? #'r)
(let ((r p))
(if r t f))))
(define-macro acond
#:keyword (else => ->)
(() (void))
(((else . b))
(begin . b))
(((e => f) (rest ...) ...)
(aif e (f it)
(acond (rest ...) ...)))
(((e p => f) (rest ...) ...)
(let ((it e))
(if (and it (p it))
(f it)
(acond (rest ...) ...))))
(((p -> r . b) (rest ...) ...)
#:fender (identifier? #'r)
(aif r p (begin . b)
(acond (rest ...) ...)))
(((p . b) (rest ...) ...)
#:capture it
(aif it p (begin . b)
(acond (rest ...) ...))))
for (i = 0; i < posts.length; i++) {
post = posts[i];
content = post.childNodes[3].innerHTML;
if (content.indexOf("\u2591") != -1)
post.style.display = "none";
}
# check whether to keep the connection open
if http_ver != 'http/1.1' or ('connection:', 'close') in headers or 'keep-alive:' in map(lambda (a, b): a, headers):
break
# get rid of empty lines before the next request
line = []
while line == []:
line = f.readline().lower().strip().split()
# parse command line arguments
argv = sys.argv[1:]
while argv:
if argv[0] == '-h':
# print help and exit
print 'options: -h display this help'
print ' -p [port] set port'
print ' -H [hostname] set hostname'
print ' -r [dir] set root directory'
exit()
elif argv[0] == '-p':
# set port number
if len(argv) == 1:
print '\'-p\' requires an argument'
exit()
port = int(argv[1])
argv = argv[2:]
continue
elif argv[0] == '-H':
# set hostname
if len(argv) == 1:
print '\'-H\' requires an argument'
exit()
host = argv[1]
argv = argv[2:]
continue
elif argv[0] == '-r':
# set root directory
if len(argv) == 1:
print '\'-r\' requires an argument'
exit()
root = argv[1]
argv = argv[2:]
# open a port
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.bind((host, port))
conn.listen(1)
# accept requests and handle in a new thread
while True:
thread.start_new_thread(handle, conn.accept())
http://codepad.org/03QsZHfW
It outputs something resembling a tree. Clever pointer tricks like this are the reason C always has an edge on "safe languages".
Name:
Anonymous2011-04-01 8:13
and here is the "/prog/" version. a lot more messy but less data http://codepad.org/LCvbTSU2 #include <stdio.h>
int main(){
char *z = " ***\0 ";
unsigned int b[] = { 0x77770000, 0x55155515, 0x40017717, 0x70014001, 0}, *c=b-1, i=0;
while(printf(!*(c+=++i-8&1)*8+" %s\t\n%s\t"+(!(i-1))*5, z+(i>5?7:i-1+!i), z+(i>4?7:i)))
do printf("%s", z+(8>>(*c&1)));
while((*c>>=1)&&!(*c>>15&1 && !(*c>>16)&&(*c>>=1)));
return 0;
}
Name:
Anonymous2011-04-01 21:35
doHarvest u -> a:u."act" d:a."dst"
-> d.{[p@_] -> r:a."res"
-> r.{no? -> r=:(canHarvest p a."harvests") -> u."act"."res"=:r}
-> if u.r>=100
then {-> o:unitTypes."store"
-> order [@o "back"=d "res"=r "depot"=a."depot"] u}
;id -> [[id u."id"] @!hideUnits]
-> o:unitTypes."harvest_inside"
-> u."act"=:[@o "dst"=d "depot"=a."depot" "range"=1
"res"=(canHarvest id a."harvests")]}
-> u
fixHarvest u -> a:u."act" d:a."dst" r:a."res" hs:a."harvests"
-> cnd{u.r>=100
-> order [@unitTypes."store" "back"=d "res"=r "depot"=a."depot"] u
;t:(findTile u."tile" (pointInRect wr ?) (canHarvest ? hs) (abs xy-?) l=6).rhd
-> [@!u."act" "dst"=[t [1 1]] "r"=no]
;ye -> u."act"=:no}
-> u
doHarvestInside u -> r:u."act"."res"
-> if u.r<100 then [[u."id" 5]@!nqs.(u."parent")."harvest"]
else {-> a:u."act" [u."id"@!showUnits]
-> o:unitTypes."store"
-> order [@o "back"=a."dst" "res"=r "depot"=a."depot"] u}
-> u
doStore u
-> a:u."act" r:a."res" depot:a."depot" t:(if depot units,depot)
-> t.{dead? -> depot.{no? -> depot=:(findDepot r u)}
-> depot.{ye? -> u."act"."depot"=:depot
;_ -> notify "Nowhere to store $r" -> u."act"=:no}
; _ -> if x:u."anims".r u."anims"."move"=:x
-> if a."near"
then {-> [[u."id" r u.r]@!nqs.(u."owner")."+"] -> u.r=:0
-> u."anims"."move" =: unitTypes.(u."type")."anims"."move"
-> o:unitTypes."harvest"
-> order [@o "dst"=a."back" "depot"=a."depot"] u}
else {-> u."act"."near"=:ye -> u."act"."dst"=:depot}}
-> u
color c00
set "DARK" to random 1 to 8
set "LIGHT" to "(&DARK&<<4o&DARK&o128)"
inc "DL" by 1
set "commands" to 30000
wait for 1
put player at 0 0
loop start
put "DARK" CustomBlock pb2 at "('loopcount'%'board_w')" "('loopcount'/'board_w'+1)"
loop for "('board_w'*('board_h'-2)-1)"
set "rcount" to 4
set "rooms" to 0
: "rd"
change from cff CustomFloor pff to "DARK" CustomBlock pb2
* "(30/'rcount')"
set "local" to random 7 to 12
set "local2" to random 6 to 10
set "local3" to random 1 to "('board_w'-1-'local')"
set "local4" to random 2 to "('board_h'-3-'local2')"
loop start
if c?? CustomFloor p20 at "('loopcount'%'local'+'local3')" "('loopcount'/'local'+'local4')" then "rd"
if "LIGHT" CustomBlock pb2 at "('loopcount'%'local'+'local3')" "('loopcount'/'local'+'local4')" then "rd"
put cff CustomFloor pff at "('loopcount'%'local'+'local3')" "('loopcount'/'local'+'local4')"
loop for "('local'*'local2'-1)"
change from cff CustomFloor pff to c08 CustomFloor p20
loop start
put "LIGHT" CustomBlock pb2 at "('local3'+'loopcount')" "local4"
put "LIGHT" CustomBlock pb2 at "('local3'+'loopcount')" "('local4'+'local2'-1)"
loop for "('local'-2)"
loop start
put "LIGHT" CustomBlock pb2 at "local3" "('local4'+'loopcount')"
put "LIGHT" CustomBlock pb2 at "('local3'+'local'-1)" "('local4'+'loopcount')"
loop for "('local2'-1)"
set "room&rooms&x" to "('local1'/2+'local3')"
set "room&rooms&y" to "('local2'/2+'local4')"
inc "rooms" by 1
if "rooms" < "rcount" then "rd"
set "rooms" to 0
: "join"
goto "#joinr"
inc "rooms" by 1
if "rooms" < "rcount" then "join"
loop start
set "local" to "('loopcount'%'board_w')"
set "local2" to "('loopcount'/'board_w')"
if "DARK" CustomBlock pb2 at "local" "local2" then "#noise"
loop for "('board_w'*'board_h'-1)"
put player at "room0x" "room0y"
copy at 2 0 to "room1x" "room1y"
set "commands" to 30
send "ALL" to "go"
* "Dungeon Level &DL&"
end
: "#noise"
set "local3" to random -30 to 30
set "local4" to "('local'+'local2'+'local3'/45+176)"
put "DARK" CustomBlock "local4" at "local" "local2"
goto "#return"
: "#joinr"
set "local" to "room&rooms&x"
set "local2" to "room&rooms&y"
set "local3" to "room('rooms'+1%'rcount')x"
set "local4" to "room('rooms'+1%'rcount')y"
set "local5" to random 0 to 1
goto "#c('local5')"
goto "#c(1-'local5')"
goto "#return"
: "#c0"
: "jrla"
goto "#pc"
inc "local" by "(('local'<'local3')-('local'>'local3'))"
if "local" != "local3" then "jrla"
goto "#pc"
goto "#return"
: "#c1"
: "jrlb"
goto "#pc"
inc "local2" by "(('local2'<'local4')-('local2'>'local4'))"
if "local2" != "local4" then "jrlb"
goto "#pc"
goto "#return"
: "#pc"
if c?? CustomFloor p20 at "local" "local2" then "#return"
put c08 CustomFloor p20 at "local" "local2"
loop start
goto "#tw"
loop for 8
goto "#return"
: "#tw"
if c?? CustomFloor p20 at "('loopcount'%3-1+'local')" "('loopcount'/3-1+'local2')" then "#return"
if "LIGHT" CustomBlock pb2 at "('loopcount'%3-1+'local')" "('loopcount'/3-1+'local2')" then "#return"
put "DARK" CustomBlock pdb at "('loopcount'%3-1+'local')" "('loopcount'/3-1+'local2')"
goto "#return"
<djahandarie> we ain't here to do e-c-e
<djahandarie> we're here to do c-s-e on the w-e-b
<djahandarie> listen to me spit these rhymes
<djahandarie> while i program lines
<djahandarie> and commit web accessibility crimes
<djahandarie> word, son
<http402> You talk like your big on these I-Net kicks,
<http402> But your shit flows slower than a two-eighty-six.
<http402> I'm tracking down hosts and nmap scans,
<http402> While Code Igniter's got you wringing your hands.
<http402> Cut the crap rap,
<http402> Or I'll run ettercap,
<http402> Grab your AIM chat,
<http402> N' send a PC bitch-slap!
<http402> peace
<djahandarie> you're talkin bout down hosts and nmap scans
<djahandarie> while i got other plans
<djahandarie> you're at your new job, but you can't even do it right
<djahandarie> you just create a plight with your http rewrites
<djahandarie> i've been on the web since the age of three
<djahandarie> you just got on directly off the bus from mississippi
<djahandarie> respect yo' elders, bitch
<http402> You've been webbin' since three, but still ain't grown up,
<http402> Gotta update your config and send the brain a SIGHUP.
<http402> You say you're that old? No wonder you're slow!
<http402> You're knocking at the door while I run this show!
<http402> Elders my ass, you're shit's still in school,
<http402> Hunt and pecking at the keyboard like a spaghetti-damned fool,
<http402> Rim-riffing your hard drive like a tool,
<http402> Face it. I rule.
<djahandarie> i erase my harddrives with magnets (bitch)
<djahandarie> all you can do is troll on the fagnets
<djahandarie> and son, my brain's wrapped in a nohup
<djahandarie> it wont be hurt by the words you throwup
<djahandarie> dont mind me while i emerge my ownage
<djahandarie> while you're still over there apt-getting your porridge
<djahandarie> you say i'm still in school
<djahandarie> but the fact is that i know the rule
<djahandarie> cuz you need to go back to grade three
<djahandarie> and you better plea, that they take sucky graduates from c-s-e
<http402> Time to bend over and apply a patch,
<http402> Your brain's throwing static like a CD with a scratch.
<http402> Your connection got nuked and you've met your match.
<http402> You run a single process like a VAX with a batch.
<http402> I'd pass the torch to a real winner
<http402> But it'd just scorch a while-loop spinner
<http402> Caught in a loop that you cant escape,
<http402> I run clock cycles around your words and flows,
<http402> Cuz your rhyme is like a PS fan: it' blows,
<http402> Your water-cooled lyrics leak and it shows,
<http402> Take your ass back to alt.paid.for.windows.
>>323 ; Input: eax = dick
move_dick_to_vagina:
; This is dead code.
;call get_vagina_ptr
;test edi, edi
;jz fallback
;mov [edi], eax
;jmp .end
.fallback:
mov ecx, [anii_count]
mov edi, anii
rep stosd
.end:
ret