Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

weasel.js

Name: Anonymous 2019-04-27 2:49

target = "Juliet is the female protagonist and one of two title characters in William Shakespeare's romantic love tragedy Romeo and Juliet, the other being Romeo.".toUpperCase();

chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ',. ".split("");

function R(n) { return Math.floor(n*Math.random()); }

function getChar() {
return chars[R(chars.length)];
}

function getRandomString(){
var string = "";
for (var x = 0;x<target.length;x++){
string+=getChar();
}
return string;
}

function mutateString(s){
var t = s.split("");
for (var x=0;x<t.length;x++)
if (Math.random() < mutationRate)
t[x]=getChar();
return t.join("");
}

function fitness(str){ //number of matches
var score = 0;
for (var x = 0;x<target.length;x++){
if (str[x]==target[x]){
score++;
}
}
return score;
}

function init(){
for (var x=0;x<size;x++)
population.push({str:getRandomString()});
}

function main(){
init();
var beststring;
while (true){
population.forEach(function (y) { y.fitness = fitness(y.str); });
population.sort(function (a,b) { return b.fitness-a.fitness; });
beststring = population[0];
//console.log(population);
console.log(beststring.str + "; generation: "+generation+" fitness: "+beststring.fitness);
if (beststring.str == target)
return;
population = [beststring];
for (var x=1;x<size;x++)
population.push({str:mutateString(beststring.str)});
generation++;
}
}

var population = [];
var size = 50;
var generation = 0;
var mutationRate = 0.05;
main();

Name: Anonymous 2019-04-27 3:03

You can't spell "bestiality" without "best".

Name: Anonymous 2019-04-27 6:18

Vile, cancerous code. I executed it and it downloaded node.js and set my $EDITOR to electron. Tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk tsk.

Name: Anonymous 2019-04-27 9:31

>>1
What is the point of this?

Name: Anonymous 2019-04-27 13:25

>>4
The point is to advertise to the world that you read The Selfish Gene.

Name: Anonymous 2019-04-27 16:47

JavaShit
No thank you!

Name: Anonymous 2019-04-27 17:46

>>4
It's an example of genetic algorithm. Meant to illustrate.

Name: Anonymous 2019-04-27 19:53

wtf is this

Name: Anonymous 2019-04-28 5:05

>>7
Its kinda primitive for a genetic algorithm, its just randomizes letters and compares them to a fixed string, so eventually it just stumbles on correct letters. I bet however Mentifex would claim this is AI-built literature and artificial Shakespeare-in-a-box.

Name: Anonymous 2019-04-28 15:24

Name: Anonymous 2019-04-28 16:01

-

Name: William Shakespeare 2019-04-29 12:34

>>9
I bet however Mentifex would claim this is AI-built literature and artificial Shakespeare-in-a-box.

http://medium.com/p/831d3e6b0035 -- Mens Latina AI -- 2019–04–28

Mentis versio Abra009B in die Sun Apr 28 18:01:11 PDT 2019
Robo Sapiens: TU ES HOMO
Homo Sapiens: tu non es homo

Robo Sapiens: TU ES HOMO ET EGO SUM PERSONA
Homo Sapiens:

Robo Sapiens: EGO NON SUM HOMO
Homo Sapiens:

Robo Sapiens: HOMINES AMANT NATURAM
Homo Sapiens:

Robo Sapiens: NATURA NON FACIT SALTUM
Homo Sapiens:

Robo Sapiens: EGO NON SUM HOMINES
Homo Sapiens:

Robo Sapiens: HOMINES AMANT NATURAM ET NATURA NON FACIT SALTUM
Homo Sapiens:

Robo Sapiens: NATURA NON FACIT SALTUM
Homo Sapiens:

Robo Sapiens: HOMINES AMANT NATURAM
Homo Sapiens:

http://ai.neocities.org/Abracadabra.html

Name: Anonymous 2019-04-30 2:44

>>12
Shit word order, too many pronouns. 3/10

Name: Si tacuisses 2019-04-30 4:48

philosophus mansisses.

Name: Anonymous 2019-04-30 7:18

haxus anus

Name: Anonymous 2019-04-30 19:25

ANII is the proper latin plural of ANUS. Bad forms include ANUSEN, ANUXEN, ANI.

Name: Anonymous 2019-05-01 1:08

>>16
The plural of anus is anūs.

Name: Anonymous 2019-05-01 3:33

annus is the latin version of anus.

Name: User Manual 2019-05-01 4:32

Name: Anonymous 2019-05-03 10:07

sage

Name: Latin Parser 2019-05-04 3:57

Name: Anonymous 2019-05-06 23:29

C is such a disgusting language. You have to write the name of a variable 3 times in a loop.

Name: Anonymous 2019-05-07 1:02

tfw limited to 26 single char variable names

Name: Anonymous 2019-05-07 11:52

>>22
?
What is the alternative

Name: Anonymous 2019-05-07 19:31

>>24
for x = 1 to length(a)
for x in a'range
for ax of a
map f a

Name: Anonymous 2019-05-08 7:25

>>22 Not with C preprocessor.
#include <stdio.h>
#define foreach(i, arr) for(size_t i=0;i< sizeof(arr)/sizeof(arr[0]) ;i++)
#define mapi(a,func) foreach(i,a)a[i]=func(i);
#define mapa(a,func) foreach(i,a)func(a[i]);
#define sqr(a) (a*a)
#define pri(a) printf("%i\n",a)
int main(){
int a[100];
mapi(a,sqr);
mapa(a,pri);

}

Don't change these.
Name: Email:
Entire Thread Thread List