>Lets make a java program /g/ (processing so the noobs can join in)
https://codeshare.io/rNQQN
I will run the code in processing 3.0 on twitch,
/rodentsnipe
Print "1488";
for ( i = 0; i > 0; i++){
console.log("Fuck you[i]");
};
>>54470850
>using the smiley with a carat nose
>>54470879
get out mike
First program by 4chan
>>54470850
id everything get baleeted?
>java
>being this indian
don't know what your ship name is
pajeet here
this is going badly
Alright guys it was fun but its 5am here, heading off.
I'll be back tomorrow with a thread where ill just take requests and change the code/pictures myself so that everyone can participate, and speed up the processing by stopping noobs from fucking it up. adios niggas
I made this short thing and I was wondering:
Is there a way to make the random number different for each time the file runs?
This isn't very interesting if it produces the same results every time.
I thought that generating a random int in a range would work,
but it did not on when I ran it on my machine.
Any ideas?import java.util.*;
import java.util.concurrent.ThreadLocalRandom;
class Meme{
private int freshness;
private String joke;
public Meme(String m){
this.joke = m;
freshness = 100;
}
public String spout(){
freshness -= ThreadLocalRandom.current().nextInt(0,11);
return this.joke;
}
public String getJoke(){return this.joke;}
public int getFresh(){return this.freshness;}
public boolean equals(Meme m){
if(this.getFresh()==m.getFresh()){return true;}
else{return false;}
}
public int compareTo(Meme m){return this.getFresh()-m.getFresh();}
}
class MemeComparitor implements Comparator<Meme>{
@Override
public int compare(Meme a, Meme b){
return a.getFresh()-b.getFresh();
}
}
public class MemeMaster{
public static void main(String[] args){
Meme[] memes = new Meme[args.length];
for(int i=0;i<args.length;i++){
memes[i] = new Meme(args[i]);
}
for(int i=0;i<args.length*8;i++){
System.out.println((memes[ThreadLocalRandom.current().nextInt(0,memes.length)]).spout());
}
Arrays.sort(memes,new MemeComparitor());
System.out.println("\nAlright, lets see what memes are on top today!"); // :")
for(int i1=1,i2=memes.length-1;i1<=memes.length;i1++,i2--){
System.out.printf("%d: %s\n",i1,(memes[i2]).getJoke());
}
}
}
>>54470850//we create a factory for factories, so we can create more abstract factories
// todo: put this into various UML charts
public abstract class AbstractFactoryFactory {
abstract abstractFactory createAbstractFactory(int… array);
}
// a meme example to demonstrate the awsomeness of inheritance
puclic class memeExampleDog extends memeExmapleAnimal{
@override
puclic void makeSound(){
System.out.println("Woof! I'm a meme.")
}
}
//test factory factory factory
public class TestFactoryFactoryFactoryPattern {
// do some testing here
try{
myMemeExampleDog = new emeExampleDog("unexpected arg");
} catch (RuntimeException e) {
// uhm... well, let' print the stack trace
e.printStackTrace(System.out);
// done
} finally {
System.out.println("You, sir, are an asshat.")
}
}
>>54472928
>using the smiley with a quote nose