[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
QUICK WRITE A PROGRAM IN YOUR FAVORITE LANGUAGE THAT GENERATES
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 179
Thread images: 16
File: killer bird.jpg (29 KB, 412x430) Image search: [Google]
killer bird.jpg
29 KB, 412x430
QUICK

WRITE A PROGRAM IN YOUR FAVORITE LANGUAGE THAT GENERATES ALL POSSIBLE PERMUTATIONS OF AN ARRAY OR LIST

OR THIS BIRD IS GONNA STAB YOU
>>
inb4 homework

public class Main {
public static void main(String[] args) {
List<Integer> a = Arrays.asList(1, 2, 3);

System.out.println(Permutator.permutate(a));
}
}


public class Permutator {
public static <T> List<List<T>> permutate(List<T> list) {
return permutate(new ArrayList<List<T>>(), new ArrayList<T>(), list);
}

private static <T> List<List<T>> permutate(List<List<T>> solutions, List<T> solution, List<T> remaining) {
if(remaining.isEmpty()) {
solutions.add(solution);
}
for(T value : remaining) {
permutate(solutions, plus(solution, value), minus(remaining, value));
}
return solutions;
}

private static <T> List<T> plus(List<T> list, T value) {
List<T> copy = new ArrayList<T>(list);
copy.add(value);
return copy;
}

private static <T> List<T> minus(List<T> list, T value) {
List<T> copy = new ArrayList<T>(list);
copy.remove(value);
return copy;
}
}
>>
File: 1467625165247.jpg (12 KB, 321x298) Image search: [Google]
1467625165247.jpg
12 KB, 321x298
GET TO WORK
>>
import Data.List

main = getLine >>= x -> (putStrLn . show . permutations) x

or something like that
>>
God damn you bird-o
>>
>>55405924
python 2
print max(int(raw_input("input a number >")), int(raw_input("input a number >")), int(raw_input("input a number >")))
>>
>>55406292
Or this

main = getLine >>= show . permutations
>>
>>55406331
lolwat
>>
>>55406337
it jusswerkz
>>
File: 1399044849083.gif (499 KB, 425x315) Image search: [Google]
1399044849083.gif
499 KB, 425x315
>>55405924
I have no idea how to code, but I think these threads are the shit. As you were /g/entoomen.
>>
Sage :^)
 
array = ["todokete", "setsuna", "sa", "ni", "wa"]
Permutations(array).list()
>>
>>55406334
thanks anon
>>
from itertools import permutations
>>
>>55405924
import ListPermutations
Pemutate
>>
>>55406408
Best one so far
>>
-[--->+<]>------.+.[----->++<]>.-[--->++<]>-.++++++++++.+[---->+<]>+++.[->+++<]>+.-[->+++<]>.++[->+++<]>.-----.++++++..++++++++.+++++.
>>
>>55405924
I actually needed to use this a few days ago but with strings so I modified it:
package main

import "fmt"

type MyArray []int

func (a MyArray) Permute() []MyArray {
res := []MyArray{}
store := func(p MyArray) {
res = append(res, append(MyArray(nil), p...))
}
a.permute(0, store)
return res
}

func (a MyArray) permute(offset int, store func(MyArray)) {
n := len(a) - 1
if offset == n {
store(a)
} else {
for j := offset; j <= n; j++ {
a[offset], a[j] = a[j], a[offset]
a.permute(offset+1, store)
a[offset], a[j] = a[j], a[offset]
}
}
}

func main() {
tests := []MyArray{
MyArray{1, 2, 3},
MyArray{1, 2, 3, 4, 5, 6, 7, 8, 9},
}
for _, t := range tests {
p := t.Permute()
fmt.Printf("SOURCE: %v\nPERMUTATIONS: %v\nTOTAL: %d\n", t, p, len(p))
}
}


loving this daily pump-a-rum btw
>>
(defun permutations (list)
(if (endp list)
(list NIL)
(nconc (mapcar (lambda (l) (cons (car list) l)) (permutations (cdr list)))
(inserts (car list) (cdr list))))

(defun inserts (item list)
(let* ((item-container (list NIL item)) (head item-container))
(cons (cons item list)
(maplist (lambda (l)
(rplacd item-container (cons (car l) (cdr item-container)))
(pop item-container)
(rplacd (cdr item-container) (cdr l)) ;
(prog1 ;
(copy-list (cdr head)) ;
(rplacd (cdr item-container) NIL))) ;
list))))

Gotta love simulating pass by reference with cons cells. An alternative to the lines marked by ; would be a simple
(append (cdr head) (cdr l))
, but it wouldn't be autistique enough.
>>
var perm = require('permutations')

return perm(array);

pretty easy desu got any more I could practice with?
>>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
vector<int> a;
vector<int>::iterator b;

for(int i = 0; i < 10; ++i)
a.push_back(i);

do {
for(b = a.begin(); b != a.end(); ++b)
cout << *b << ' ';
cout << endl;
} while(next_permutation(a.begin(), a.end()));

return 0;
}
>>
>>55405924
#include <iostream>    
#include <algorithm>
#include <vector>
#include <iterator>
#include <random>
int main()
{
unsigned int n = 5;
std::vector<int> vecP;
std::random_device rn;
std::mt19937_64 gen(rn());
std::uniform_int_distribution<> dist(1, 100);
for (auto i = 0; i < n; i++)
{
vecP.push_back(dist(gen));
}
std::cout << std::endl;
std::sort(vecP.begin(), vecP.end());
do
{
for (std::vector<int>::iterator it = vecP.begin(); it != vecP.end(); it++)
{
std::cout << *it << " ";
}
std::cout << std::endl;
} while (std::next_permutation(vecP.begin(), vecP.end()));
return 0;
}
>>
>>55406545
void userPermutation(std::vector<int> usVec)
{
do
{
for (std::vector<int>::iterator it = usVec.begin(); it != usVec.end(); it++)
std::cout << *it << " ";
std::cout << std::endl;
} while (std::next_permutation(usVec.begin(), usVec.end()));
}
>>
>>55405924

# Ruby
['OP', 'is', 'a', 'faggot'].permutation.to_a
>>
>>55406334
Couldn't match type `[Char]' with `IO b'
Expected type: [[Char]] -> IO b
Actual type: [[Char]] -> String

main = getLine >>= print . permutations
>>
>>55407171

Or if you have multiple values and only want unique permutations in the result:

[0,1,0,1].permutation.to_a.uniq
>>
>>55407295

Is that Haskell?
Noice..
>>
>>55406646
>tfw random_device always returns 0 instead of hardware-based seed on MinGW
>still not fixed in latest version, not even on mingw-w64
>under windows I'd have to use MSVC
>which is tied to an IDE instead of the simple commands of gcc
I was gonna kill myself anyways...

Or I could stick to muh loonix anyways.
Also, my solution to this is, to seed mt19937_64 with time(0). Good enough unless it's super long or cryptographics.
>>
>>55406292
>>55406334
>>55406374
>>55406408
>>55406436
>>55406524
>>55407171
>>55407295
>>55407314
Everyone of you is getting stabbed. The bird clearly wanted to see your implementation, not just a function call.
>>
I like you OP
>>
Can someone link the previous threads?
>>
>>55407681

I don't get your point?

This here is Ruby core library, without any import at all:
my_array = gets.chomp.split
my_array.permutation.each { |i| puts i.join(" ") }


You can test it here:
>https://repl.it/languages/ruby


How can you "write a programm in your favorite langauge" when you aren't allowed to use it's functions???
>>
>>55407295
Why not just

 main = permutations <$> getLine 


He never said anything about it having to be a string or printing it.
>>
File: forthebird.webm (2 MB, 1670x845) Image search: [Google]
forthebird.webm
2 MB, 1670x845
>>55405924
is The Bird pleased with my contribution
>>
>>55407769
Confirmed for never having passed any job interviews.
>>
>>55407732
> go to archive/archive sites.
> text search "or this bird gunna stab you".
> be less retarded than you are now.
>>
>>55408003
Sorry but I don't try to get hired by violent birds
>>
>>55407769
because the point is to see an implementation
think of it as a job interview to show what you're capable of not what your language has built-in
>>
>>55405924
Use Mathematica:

Permutations[list]


Any language shorter than this?
>>
>>55405924
>Stackoverflow permutations programming_language
>ctrl+c
>ctrl+v
>tidy up
>>
>>55408050
J
 A.&i.~ ! 
>>
Using a generator to minimize space and time requirements until needed:
function permute(arr) {
let used = new Array(arr.length);
let data = new Array(arr.length);
return (function* bt(pos) {
if(pos == arr.length)
return data.slice();

for(var i=0; i<arr.length; i++) {
if(used[i])
continue;

used[i] = true;
data[pos] = arr[i];
yield* backtracking(pos+1);
used[i] = false;
}
})(0);
}
>>
>>55408030

>"Hey Anon, write a programm in your favorite langauge that does this and that".
>"ok, here."
>"HURRR, YOU MUST NOT USE FUNCTIONS!"

I don't even get what you are trying to say..

You would probably also ask someone to do sql queries, but without using "select", right?

This damn board..


If you want special rules, than say something like "you are only allowed to use bitshift and hexcode", otherwise STFU.
>>
>>55408233
i can't force you not to be neet
do whatever makes you sleep at night, just know that it's pointless
>>
>>55408233
>database engineer position
>how would you implement an index hashing table?
>don't need to, all the databases already have this included LOL
>don't call us we'll call you
>>
>>55405924
Python 3
def permutations(seq):
def _permuterec(subseq, i):
if (i >= len(subseq) - 1):
yield list(subseq)
else:
yield from _permuterec(subseq, i + 1)
for j in range(i + 1, len(subseq)):
a, b = subseq[i], subseq[j]
subseq[i], subseq[j] = b, a
yield from _permuterec(subseq, i + 1)
subseq[i], subseq[j] = a, b
subseq = list(seq)
yield from _permuterec(subseq, 0)
>>
>>55408233
A language isn't solely characterized by its functions. OP is referring to any language, and it shouldn't be used in this case with its libraries. In this context, what matters the most in your favorite language is its grammar, its syntax and the way it lets you compute data, not its usefulness and "pre-built" complex functions.
>>
>>55405924

KISAMA!
>>
File: 1466007286813.jpg (91 KB, 750x923) Image search: [Google]
1466007286813.jpg
91 KB, 750x923
>>55405924
def all_permz(elementz):
if len(elementz) <=1:
yield elementz
else:
for perm in all_permz(elementz[1:]):
for i in range(len(elementz)):
yield perm[:i] + elementz[0:1] + perm[i:]
>>
File: bird2.webm (2 MB, 1488x865) Image search: [Google]
bird2.webm
2 MB, 1488x865
>>55407966
I found out why it fails for N=4

not because of race conditions but because I reached the clone limit and had not deleted hidden/unused clones
>>
>>55408542
Permutations means without duplicates, anon.
These are the permutations of ABC:
A B C
A C B
B A C
B C A
C A B
C B A
>>
>>55408599
nooo

that is combinations
>>
>>55408612
Combinations is subsets of a set with order being irrelevant. The 2-element cominations of the set A B C are

A B
A C
B C
>>
>>55408622
>>55408599
>>55408612
oh I see

it still looks pretty dank though
I hope the bird will accept
>>
cheating:

library(permn)
v1 <- rep(1:5)
permn(v1)
>>
:s
start %0
goto :s

Just save that as array.bat and your homework's finished.
>>
>>55408301
>>55408391

Funny enough I work with databases.
And guess what? Nobody asked me to explain the differnce between pessimistic locking and optimistic locking. But they wanted to know how I would set up a database for a certain problem (which was my first project there, btw).

You shouldn't believe the FizzBuzz meme.


>>55408436

>A language isn't solely characterized by its functions.

This is true.
But languages have special design purposes, for example Ruby has a lot of power when it comes to processing lists, arrays and such stuff, but is not that great when it comes to higher math. If I was looking for an employee, I'd be interested if he
a) knows the language
b) can solve a problem

Not if he is the ultimate compiler engineer and can solve NP hard problems with boolean logic alone.

>OP is referring to any language, and it shouldn't be used in this case with its libraries.

Again, I used no libraries.

> In this context, what matters the most in your favorite language is its grammar, its syntax and the way it lets you compute data

But that's a viscious circle..
If I just say "the solution is: array.function_1" he'll say "no, that isn't allowed"
So I'll break "function_1" down into "function_2(function_3)" ..but alas - they are still too high level!

We can play this the whole night until we arrive at low level loops, accumulators and if statements.

So why not just saying: "solve this problem in pseudocode" in the first place? Makes no sense to me.
>>
>>55405924
(code) How do I insert code? (code)

plz halp
>>
>>55409511
like this?
>>
This was surprisingly hard to do. I just could not wrap my head around how to do it for a long time.

Now I've solved it and added sufficient amount of comments so others could maybe understand what they need to do.

// Define an array which permutations will be calculated
let input = ["a", "b", "c", "d", "e"];

// Get all the permutations of given array
function get_permutations(input)
{
let results = []; // Initialize an array for results

// New function is needed for recursion within
// the scope results is defined in.
function permute(input, temp = [])
{ // Current will either be temp
// or default to an empty array
let current = temp || [];

// Loop over every index of an input
for (let i in input)
{ // Remove input[i] from input
current = input.pop(input[i]);

if (input.length == 0)
{ // Concatenate current to temp, push
// resulting array into results
results.push(temp.concat(current));
}
// Recursively call permute() with a copy of
// input and a union of temp and current
permute(input.slice(), temp.concat(current));
input.splice(i, 0, current[0]); // Remove input[i]
} // from input and add current[0] into index 0

return results; // Return results to get_permutations
}

return permute(input); // Return permutations to caller
}

// Loop over every item from get_permutations
for (let line of get_permutations(input))
{
// Print out every line
console.log(line);
}
>>
# Fucking shit java 
# duplicates allowed

def toString(List):
return ''.join(List)

# Function to print permutations of string
# three parameters:
# 1. String
# 2. Starting index of the string
# 3. Ending index of the string.
def permute(a, l, r):
if l==r:
print toString(a)
else:
for i in xrange(l,r+1):
a[l], a[i] = a[i], a[l]
permute(a, l+1, r)
a[l], a[i] = a[i], a[l] # backtrack

# testing stuff
string = "ABC"
n = len(string)
a = list(string)
permute(a, 0, n-1)
.
>>
File: 4chan.png (17 KB, 309x240) Image search: [Google]
4chan.png
17 KB, 309x240
>>55409511
Like this
>>
>>55409538
there is also doing an iterative solution
>>
File: 90354dfdd10c259c6ee8a52f.jpg (40 KB, 680x510) Image search: [Google]
90354dfdd10c259c6ee8a52f.jpg
40 KB, 680x510
Not today, knifebirb!

import sys

items = sys.argv[1:]

if not items:
sys.exit('The OP is a faggot')
elif len(items) == 1:
sys.exit(items)

def recurse(items, permutations, picks = None):
if not picks:
picks = []

if len(items) > 2:
for i in range(len(items)):
recurse(items[:i] + items[i + 1:], permutations, picks + [items[i]])
else:
permutations.append(picks + items)
permutations.append(picks + items[::-1])

permutations = []
recurse(items, permutations)

for permutation in permutations:
print permutation
>>
>>55405924
(defun all-permutations (list)
(cond ((null list) nil)
((null (cdr list)) (list list))
(t (loop for element in list
append (mapcar (lambda (l) (cons element l))
(all-permutations (remove element list)))))))
>>
>>55405924
>What is backtracking

Do your own homework anon
>>
>>55408391
Sounds like Not Invented Here to me, you only did yourself a favor.
>>
>>55409567
I will, just needed to do it once somehow to do a good solution next.
>>
>>55409576
>picks = []
I think that writing
picks = picks or []
is clearer.
>>
>>55409558
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void main(String[] args) {
String input = "ABCA";
permutate(input, "");
}

// This recursive method is exactly like generating permutation
// except now the recursive calls are made for only the unique letters

private static void permutate(String input, String builder) {
if (input.length()==0){
System.out.println(builder);
return;
}
HashSet<String> uniqueLetters = getUniqueLetters(input);
for (int i = 0; i<input.length(); i++){
String s = ""+ input.charAt(i);
if (uniqueLetters.contains(""+s)){
String s1 = input.substring(0, i)+input.substring(i+1,input.length());
permutate(s1, builder+""+s);
uniqueLetters.remove(s);
}
}
}

// Returns a hashset with just the unique letter
private static HashSet<String> getUniqueLetters(String input) {
HashSet<String> set = new HashSet<String>();
for (int i = 0; i < input.length(); i++)
if (!set.contains("" + input.charAt(i))) {
set.add("" + input.charAt(i));
}
return set;
}
}
>>
Please, don't kill me little birdo.

from itertools import *
print(list(permutations([0,1,2,3,4,5,6,7,8,9])))
>>
>>55409511

Delete the spaces:

[ c o d e ]
// your code here

[ / c o d e ]
>>
File: d40d2a7b1189f6c5c6c2163c.jpg (35 KB, 470x370) Image search: [Google]
d40d2a7b1189f6c5c6c2163c.jpg
35 KB, 470x370
>>55409654
Top notch, I never thought of that.
>>
File: fuggbird.png (88 KB, 1307x840) Image search: [Google]
fuggbird.png
88 KB, 1307x840
>>55405924
TAKE THAT BIRD!!!!
>>
>>55409565
void stringPerm(std::string s, int len, int i = 0)
{
if(i == len)
std::cout<<s<<'\n';
else
{
for(int j = i; j < len; ++j)
{
if(i != j && s[i] == s[j])
continue;
std::swap(s[i], s[j]);
stringPerm(s, len, i + 1);
std::swap(s[i], s[j]);
}
}
}
>>
make:: permutations
>>
from random import shuffle
from math import factorial

def permutations_of(a):
permutations = []
while(len(permutations) < factorial(len(a))):
if a[:] not in permutations:
permutations.append(a[:])
shuffle(a)
return permutations
>>
Wew, /g/ once again does the homework of a lazy fuck. End yourselves.
>>
>>55408479
me likez yo stylez
>>
>>55409908
you get duplicates with this
>>
>>55405924
ok this is stupid
some_list.permutation

btw this is ruby
>>
>>55405949
Oh yeah, this shit is better than COBOL right? Fuck off.

We should've stopped at COBOL-85
>>
>>55405924
what about multi dimensional arrays?
>>
python master race

import itertools


def genertate_permutations(some_input):
return list(itertools.permutations(some_input))
>>
>>55406463
>Prints hello world

Try harder anon
>>
>>55405924
Actually I love these threads. Thanks for making them op. I'm new to programming and seeing these examples really helps me out.
>>
>>55410939
a multi dimensional array is just an array of arrays so you just permute them
>>
you guys are nerds
>>
>>55406471
>Go
muh nigga
>>
permutePoint :: Int -> Int -> [a] -> [a]
permutePoint x y xs
| boundsCheck = (take y xs') ++ (x':(drop (y + 1) xs'))
| otherwise = xs
where boundsCheck = x < (length xs) && y < (length xs)
x' = xs !! x
y' = xs !! y
xs' = (take x xs) ++ (y':(drop (x + 1) xs))

permutations :: [a] -> [[a]]
permutations xs = (permutePoint 0 0 xs):
[ permutePoint m n xs | m <- [0..l], n <- [m + 1..l]]
where l = length xs - 1
>>
import itertools

def permutations(array):
if len(array) == 1:
return [array]

perms = []
for i in range(len(array)):
for p in permutations(array[:i] + array[i+1:]):
perms.append([array[i]] + p)

return perms

for p in permutations([1,2,3,4,5,6]):
print (p)

..or just itertools.permutations().
>>
>>55412122

FUCK! I just realized I dun goof'd.
>>
>>55406089
the boys are working hard bird please drop the weapon
>>
print("Hello World :3")
>>
>>55412395
You're hired.
>>
>>55406523
LISP has to be one of the most retarded languages I've ever seen. How do you read that shit embedded in so many fucking parentheses
>>
>>55412122
What language is this?
>>
>>55413209
Memeskell
>>
>>55412667
lisp isn't meant to be read it's meant to make you feel superior
>>
>>55410097
Suicide yourself

Stabby Bird is an essential part of /g/ culture
>>
I got this shit, I'll come back with the appropriate currynigger code.
>>
File: 1394.jpg (29 KB, 446x357) Image search: [Google]
1394.jpg
29 KB, 446x357
>>55405949
>private static <T> List<List<T>> permutate(List<List<T>> solutions, List<T> solution, List<T> remaining)
>>
>>55413980
how new are yout?
>>
>>55414144
Hey buddy I've been here all summer :)
>>
>>55414197
jokes on you, i've been here since april
>>

<html><body>

<script>
function permutate( listMain, listOut, listOutTotal ) {

if( listMain != null )
if( listMain.length > 0 ) {

for( var i = 0; i < listMain.length; i++ ) {

var listMainCopy = listMain.slice();
var listOutCopy = listOut.slice();

listOutCopy.push( listMainCopy[i] );
listMainCopy.splice( i, 1 );

permutate( listMainCopy, listOutCopy, listOutTotal );
}
} else {

listOutTotal.push( listOut );
}

}

var listOutTotal = [];

permutate( [1, 2, 3, 4], [], listOutTotal );


for( var y = 0; y < listOutTotal.length; y++ ) {
for( var x = 0; x < listOutTotal[y].length; x++ )
document.write( listOutTotal[y][x] + "," );

document.write("<br/>");
}


</script>
</body>
</html>

>>
>>55414116
Welcome to Java.
>>
>>55414085
God I'm an awful "coder"
>>
#include <cstdio>

int indices[99999] = {0};
int perm=0;
void permutacoes(int* vetor_original, int atual, int n)
{
if(atual == n)
{
for(int i=0; i < n; i++)
printf("%i ", vetor_original[indices[i]]);

printf("\n");
perm++;
}

for(int i=0; i < n; i++)
{
for(int b=0; b < atual; b++)
if(indices[b] == i)
goto FIM;
indices[atual] = i;
permutacoes(vetor_original, atual+1, n);
FIM:
;
}
}

int main()
{
int teste[] = {1, 2, 3, 4, 5, 6, 7};
permutacoes(teste, 0, 7);
printf("%i\n", perm);
}

Is this enough
>>
>>55415824
>int indices[99999]

JOHNSON, WE NEED MORE RAM
>>
>>55412667
That code is retarded, not the language. Here's a better solution:
(defun permutations (list)
(if (endp list)
(list NIL)
(mapcan (lambda (x)
(mapcar (lambda (y) (cons x y))
(permutations (remove x list)))))
list)))
>>
Here's some hasklel

Code:
-- Every possible way to choose one element from the list
slice :: [a] -> [(a, [a])]
slice [] = []
slice (x : xs) =
let restSlices = slice xs
in (x, xs) : map (add2Slice x) restSlices
where add2Slice x (y, ys) = (y, x : ys)

perm :: [a] -> [[a]]
perm [] = [[]]
perm xs = do
(y, ys) <- slice xs
restPerm <- perm ys
return (y : restPerm)


REPL output:
λ> perm [1,2,3,4]
[[1,2,3,4],[1,2,4,3],[1,3,2,4],[1,3,4,2],[1,4,2,3],[1,4,3,2],[2,1,3,4],[2,1,4,3],[2,3,1,4],[2,3,4,1],[2,4,1,3],
[2,4,3,1],[3,1,2,4],[3,1,4,2],[3,2,1,4],[3,2,4,1],[3,4,1,2],[3,4,2,1],[4,1,2,3],[4,1,3,2],[4,2,1,3],[4,2,3,1],[
4,3,1,2],[4,3,2,1]]
λ> perm "memes

<interactive>:7:12:
lexical error in string/character literal at end of input
λ> perm "memes"
["memes","memse","meems","meesm","mesme","mesem","mmees","mmese","mmees","mmese","mmsee","mmsee","meems","meesm
","memes","memse","mesem","mesme","mseme","mseem","msmee","msmee","mseem","mseme","emmes","emmse","emems","emes
m","emsme","emsem","emmes","emmse","emems","emesm","emsme","emsem","eemms","eemsm","eemms","eemsm","eesmm","ees
mm","esmme","esmem","esmme","esmem","esemm","esemm","mmees","mmese","mmees","mmese","mmsee","mmsee","memes","me
mse","meems","meesm","mesme","mesem","memes","memse","meems","meesm","mesme","mesem","msmee","msmee","mseme","m
seem","mseme","mseem","emems","emesm","emmes","emmse","emsem","emsme","eemms","eemsm","eemms","eemsm","eesmm","
eesmm","emmes","emmse","emems","emesm","emsme","emsem","esmem","esmme","esemm","esemm","esmme","esmem","smeme",
"smeem","smmee","smmee","smeem","smeme","semme","semem","semme","semem","seemm","seemm","smmee","smmee","smeme"
,"smeem","smeme","smeem","semem","semme","seemm","seemm","semme","semem"]
>>
>>55412122
Haskell babby
>>
>>55416219
Much better Haskell
>>
pls no stab bird
the_permutation = '' 
u_put= list(input())
def permutation_protocal(u_put):
for x in u_put:
return the_permutation + str(x)
u_put = u_put.remove(x)
permutation_protocal(u_put)

return the_permutation

>>
>>55415824
Goto desnecessário, anão. Só um return era suficiente.
>>
>>55408479
Did you copy it from Stackoverflow?
http://stackoverflow.com/a/104436
>>
heres my try with c++ template metaprogramming.
the permutation is in the type itself.

its really ugly and hacky

#include <utility>
#include <algorithm>
#include <iostream>

struct array { int a[6]; };

constexpr array next(array a) {
auto first = &a.a[0];
auto last = &a.a[6];
auto i = last;
--i;
for(;;) {
auto ii = i;
--i;
if (*i < *ii) {
auto j = last;
do {--j;}while(!(*i < *j));
auto tmp = *i;
*i = *j; *j = tmp;
do {
--last; tmp = *ii; *ii = *last; *last = tmp; ++ii;
} while(ii < last);
return a;
}
if (i == first) {
std::reverse(first, last);
return a;
}
}
}


template<int... S> using sequence = std::integer_sequence<int, S...>;
template<size_t... I> struct permutator {
template<int... S> constexpr auto next_perm(sequence<S...>) {
return sequence<
next(array{S...}).a[I]...
>{};
}
};

#include <boost/core/demangle.hpp>
#include <typeinfo>
void print(auto p) {
using boost::core::demangle;
std::cout << demangle(typeid(p).name()) << '\n';
}

int main() {
permutator<0,1,2,3,4,5> p;
auto s0 = sequence<1, 2, 3, 4, 5, 6>{};
print(s0);
auto s1 = p.next_perm(s0); print(s1);
auto s2 = p.next_perm(s1); print(s2);
auto s3 = p.next_perm(s2); print(s3);
auto s4 = p.next_perm(s3); print(s4);
};


the output
std::integer_sequence<int, 1, 2, 3, 4, 5, 6>
std::integer_sequence<int, 1, 2, 3, 4, 6, 5>
std::integer_sequence<int, 1, 2, 3, 5, 4, 6>
std::integer_sequence<int, 1, 2, 3, 5, 6, 4>
std::integer_sequence<int, 1, 2, 3, 6, 4, 5>
>>
>>55416219
Haskell flavored Scheme
(define (flatMap k xs)
(cond ((null? xs) '())
(else (append (k (car xs)) (flatMap k (cdr xs))))))

(define (const a)
(lambda (b) a))

(define (return x)
(cons x '()))

(define-syntax h-do
(syntax-rules (<-)
((h-do (name <- expr) clause2 ...)
(flatMap (lambda (name) (h-do clause2 ...)) expr))
((h-do expr) expr)
((h-do clause clause2 ...)
(flatMap (const (h-do clause2 ...)) clause))))

(define (add2Slice elem)
(lambda (slice)
(cons (car slice) (cons elem (cdr slice))))) ;;Fuck lists

(define (slice xs)
(cond ((null? xs) '())
(else
(let ((restSlices (slice (cdr xs)))
(firstSlice (cons (car xs) (cdr xs))))
(cons firstSlice
(map (add2Slice (car xs)) restSlices))))))

(define (perm xs)
(cond ((null? xs) '(()))
(else (h-do
(slice1 <- (slice xs))
(restPerm <- (perm (cdr slice1)))
(return (cons (car slice1) restPerm))))))


I spent forever on a dumb mistake. In the recursive case of flatMap I had flatMap k xs instead of flatMap k (cdr xs), but I thought the error was in the macro for some reason.

Output:
1 ]=> (perm '(1 2 3 4))

;Value 14: ((1 2 3 4) (1 2 4 3) (1 3 2 4) (1 3 4 2) (1 4 2 3) (1 4 3 2) (2 1 3 4) (2 1 4 3) (2 3 1 4) (2 3 4 1)
(2 4 1 3) (2 4 3 1) (3 1 2 4) (3 1 4 2) (3 2 1 4) (3 2 4 1) (3 4 1 2) (3 4 2 1) (4 1 2 3) (4 1 3 2) (4 2 1 3)
(4 2 3 1) (4 3 1 2) (4 3 2 1))
>>
>>55417293
shit, how did formatting get so screwed up?
>>
def permutate(n,liste):
if n == 1:
print(liste)
else:
for i in range(0,n-1):
permutate(n-1,liste)
if (n % 2):
liste[0], liste[n-1] = liste[n-1], liste[0]
else:
liste[i], liste[n-1] = liste[n-1], liste[i]
permutate(n-1,liste)

user_input = 0
liste = []
while user_input != -1000000000:
user_input = float(input("Enter number(End:-1000000000): "))
if user_input == -1000000000:
break
liste.append(-1000000000)
permutate(len(liste),liste)
>>
>>55417526
Damn
def permutate(n,liste):
if n == 1:
print(liste)
else:
for i in range(0,n-1):
permutate(n-1,liste)
if (n % 2):
liste[0], liste[n-1] = liste[n-1], liste[0]
else:
liste[i], liste[n-1] = liste[n-1], liste[i]
permutate(n-1,liste)

user_input = 0
liste = []
while user_input != -1000000000:
user_input = float(input("Enter number(End:-1000000000): "))
if user_input == -1000000000:
break
liste.append(user_input)

permutate(len(liste),liste)
>>
>>55412122

Me again. Finally figured this shit out.

data Tree a = Node a [Tree a]
| Empty
deriving Show

treeFy :: (Eq a) => [a] -> [Tree a]
treeFy [] = []
treeFy xs = let xs' = map (removeElem xs) xs
in map (fst . makeNode) xs'

removeElem :: (Eq a) => [a] -> a -> (a,[a])
removeElem xs x = (x, (takeWhile (/= x) xs) ++ tail(dropWhile (/= x) xs))

makeNode :: (Eq a) => (a, [a]) -> (Tree a, [a])
makeNode (x, []) = (Node x [], [])
makeNode (x, xs) = (Node x (treeFy xs), snd(removeElem xs x))

pathList :: Tree a -> [[a]]
pathList tree = map reverse $ traverse [] tree
where traverse path (Node x []) = [x:path]
traverse path (Node x xs) = concat $ map (traverse (x:path)) xs

pathListToString :: (Show a) => [[a]] -> [String]
pathListToString xs = map (++ "\n") (map show (concat xs))

main = do
let x = concat (pathListToString (map pathList (treeFy [1..5])))
putStrLn x
>>
>>55405924
let index_list len =
if len < 0 then
raise (invalid_arg "len must be > 0")
else
let rec aux' l i =
if i = len then l
else i::(aux' l (i + 1)) in
aux' [] 0
;;

let remove_at i indexed_list =
let rec aux' i indexed_list found =
match indexed_list with
| [] -> []
| (ind, elem)::xs ->
if found then (ind - 1, elem)::(aux' i xs true)
else
if i <> ind then (ind, elem)::(aux' i xs false)
else (aux' i xs true)
in
aux' i indexed_list false
;;

let rec permute l =
let indexed_list = List.combine (index_list (List.length l)) l in
let fx (ind, elem) acc =
let l' = remove_at ind indexed_list in
let (_, vals) = List.split l' in
let sub_permutes = permute vals in
let permuted = List.map (fun e -> elem::e) sub_permutes in
permuted @ acc
in
if l = [] then [[]] else List.fold_right fx indexed_list []
;;


This took way longer than it should have because of a couple of dumb bugs.
>>
>>55418577
as a sidenote, why is the ocaml standard library so poor? why is it so hard to work with list indices? I could have done this so much faster if I didn't have to create a new function and stop my reasoning every step of the way.
>>
>>55405949
Fucking Java
>>
>>55405924
I honestly don't know how to do this.
guess im a codemonkey
>>
>>55418711
think inductively

[] -> [[]]
[a] -> [[a]]
[a, b] -> [[a, b], [b, a]]
[a, b, c] -> [[a, b, c], [a, c, b], [b, a, c], [b, c, a], [c, a, b], [c, b, a]]

Notice the pattern? You just remove one element from the list, make all possible combinations of the others (recurse) and add the element you removed again. Repeat for all elements in the original list.

If this still confuses you, try doing a simpler exercise first: Generate the "powerset" of a list ([1, 2, 3] -> [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]])
>>
>>55416219
I have no idea how this works
is this what being a pleb feels like?
>>
>>55416744
umm obviously not. he removed the comment and wrote permz instead of perms
>>
a.permute
Thanks ruby
>>
>>55418826
I'm trying to figure it out, too. The problem with Haskell is that once I get into it, I get it, but that takes like a week, then I don't do it, and then I forget how to read it again.
>>
HEY GUYS AM I DOING IT RIGHT?
for i in {a..z}{0..9}{a..z}{0..9}{a..z}; do echo $i; done
>>
>>55405924
well i don't know this off the top of my head, and am far too busy to teach myself at this time. So I guess I will get stabbed by a bird again.

Also if you stupid friend ever talks about a flying weaponized raptor project after watching Jurassic park movies, he is really just planning to just tape knives to his wife parrot's feet. Stop him before you end up in the hospital.
>>
>>55418826
>>55419433
Any specific confusing parts? I'm guessing it's the do block used in context of lists
>>
>>55416219
>>55420333
The slice function's comment is a bit incomplete, it should really say "Every way to choose one element from the list, and also get the remaining elements". I basically use it to choose which element comes first.

This is how the slice function works:
If I have no elements, there are no ways to pick an element.
If I do have an element, I either pick the first element, or one of the other elements. Calling slice on the rest of the elements gives me all the possible ways to get one element from the tail, rather than the whole list. Each way to pick an element is going to be in the form (y, ys), where y is one element from xs, and ys is everything else in xs. Conceptually, I chose y to be taken out of the list, instead of x. But I need to add x back in since ys only contains the remaining elements from xs, not the whole list (which is x:xs). add2Slice accomplishes that part. "add2Slice x" gives a function that will add x to the slice, so I map that over restSlices, which are the different ways to pick an element from xs. That gives me all the picks that are not x, so I put the choice of picking x at the front, which is (x, xs), since I chose x, and the remaining elements are xs.

The permutations for an empty list is only the single list with no elements. For a nonempty list, you pick one element to go in the front, and then permute the rest of the elements. This is reflected in perm:
If a list has zero elements, there is one permutation, which is the empty list.
The recursive case is equivalent to (if you know Python) the list comprehension
[y : restPerm | (y, ys) <- slice xs, restPerm <- perm ys]. For every possible choice of the first element in the permutation, I get every possible permutation of the unpicked elements. Then I stick the first one picked on front. This gives all the possible permutations.
>>
>>55420333
just visualizing how it all works
and yes, whats up with using do's like that, its meant for IO, right?
>>
poo poo pee pee
>>
>>55420538
It's actually more general than IO. A do block is syntax sugar:
do
(y, ys) <- slice xs
restPerm <- perm ys
return (y : restPerm)
==
slice xs >>= \(y, ys) ->
perm ys >>= \restPerm ->
return (y : restPerm)

(Assuming you understand lambdas, \ is lambda)
>>= is a "flatMap" operator. If >>= is defined for some "m", then it has the type
(>>=) :: m a -> (a -> m b) -> m b

-- for lists
(>>=) :: [a] -> (a -> [b]) -> [b]

In the case of lists, (list >>= f) applies f to each element of list, and concatenates all the results. For example:
[1, 2, 3] >>= \x -> [x + 1, x + 2]
===
concat [[2, 3], [3, 4], [4, 5]]
===
[2, 3, 3, 4, 4, 5]

If "m" has a return function, it has the type:
return :: a -> m a

-- for lists
return :: a -> [a]

"return x" puts x in some "default" context. In the example of lists, it is the singleton list [x]. In general, return has to satisfy "return x >>= f === f x". That is, doing "return x" adds no extra information to x, so you might as well have just applied the function directly.

Any kind of "m" that has these two operations is called a Monad. The reason people hype Monads is because it's a general interface that fits lots of types, and also is a useful interface to target. For example, you can make looping constructs that work for any Monad:
while :: Monad m => m Bool -> m a -> m ()
while condition body = do
check <- condition
if check then body >> (while condition body) else return ()

("Monad m => ..." just means, "while exists for any m that is a Monad, and it has this type")
This kind of loop though, I'm not sure if anyone would use in context except in the context of m = IO.
>>
>>55420679
So going back to perm,
slice xs >>= \(y, ys) ->
perm ys >>= \restPerm ->
return (y : restPerm)
===
slice xs >>= (\(y, ys) ->
perm ys >>= (\restPerm ->
return (y : restPerm)))

We can see how this evaluates for xs = [1, 2, 3]

-- For conciseness, define:
subfunction2 y permut = return (y : permut)
subfunction (y, ys) = perm ys >>= permut y

perm [1, 2, 3]
===
slice [1,2,3] >>= (\(y, ys) ->
perm ys >>= (\restPerm ->
return (y : restPerm)))
===
slice [1,2,3] >>= (\(y, ys) ->
perm ys >>= subfunction2 y)
===
slice [1,2,3] >>= subfunction
===
[(1, [2, 3]), (2, [1, 3]), (3, [1, 2])] >>= subfunction
===
concat [subfunction (1, [2, 3]), (2, [1, 3]), (3, [1, 2])]
===
concat [perm [2, 3] >>= subfunction2 1, ...]
=== (Assume perm works for sake of recursion)
concat [[[2, 3], [3, 2]] >>= subfunction2 1 ... ]
===
concat [concat [subfunction2 1 [2, 3], subfunction2 1, [3, 2]] ...]
===
concat [concat [return (1 : [2, 3]), return (1 : [3, 2])], ... ]
===
concat [concat [[[1, 2, 3]], [[1, 3, 2]]] ...]
===
concat [[[1, 2, 3], [1, 3, 2]], ...]
===
[[1, 2, 3], [1, 3, 2], ...]

This only shows the first couple of permutations, but hopefully you get the idea.
>>
>>55420863
should be
subfunction (y, ys) = perm ys >>= subfunction2 y
>>
>>55420863
And
concat [subfunction (1, [2, 3]), (2, [1, 3]), (3, [1, 2])]

-- should be
concat [subfunction (1, [2, 3]), subfunction (2, [1, 3]), subfunction (3, [1, 2])]

concat [[[2, 3], [3, 2]] >>= subfunction2 1 ... ]

-- should be

concat [[[2, 3], [3, 2]] >>= subfunction2 1], ... ]
>>
>>55407966
fucking nice
>>
>>55405924
import perm_generator
perm_generator.generate()
>>
Someone do it in Brainfuck.
>>
>>55420940
You will probably need to do it in some other language and compile that to brainfuck
>>
I see, but its still confusing to use them outside IO
the list comprehension makes more sense (yes I know list comps are basically do's)

>>55420863
>>55420876
>>55420894
holy crap, its very complicated, but I understand now
thanks senpai
>>
void permut(unsigned k) { 
unsigned i, swap;
if (k == 0)
print();
else {
permut(k - 1);
for (i = 0; i < k - 1; i++) {
swap = a[i];
a[i] = a[k-1];
a[k-1] = swap;
permut(k - 1);
swap = a[i];
a[i] = a[k-1];
a[k-1] = swap;
}
}
}
>>
>>55421261
Ughh fucked up the indentation
>>
File: 1452869860762.png (226 KB, 620x670) Image search: [Google]
1452869860762.png
226 KB, 620x670
>>55408021
>>
>>55417293
>having to define flatMap
Just use mapcan.
>>
import sys
import json
import itertools

argLst = sys.argv

inp_arg = argLst[1]
out_arg = argLst[2]

inp_file = open(str(inp_arg), 'r').read()
inp = json.loads(inp_file)

out_file = open(str(out_arg), 'w')

def unique_combinations(*args):

out = None

for combination in itertools.product(*args):
out = combination
print(combination)
out_file.write(str(out) + "\n")

out_file.close()

lst = []

for i in inp:

val = inp.get(i)

wowLst = []

for string in val:
wow = str(string)
wowLst.append(wow)

lst.append(wowLst)

print(inp)

unique_combinations(*lst)
>>
>>55422102
Thanks. Though I looked it up and it looks like Scheme has something called append-map (as part of an SRFI) rather than mapcan. However, mit-scheme has both, and they look like they have the same functionality at first glance.
>>
poo in loo edition using the algorithm on wikipedia

import java.util.Arrays;

public class Permutation
{
private int[] a;

public Permutation(int[] a)
{
this.a = a;
}

// returns the next permutation lexicographically
public void next()
{
// find the largest index k such that a[k] < a[k + 1]
int k = a.length - 2;
while (a[k] >= a[k + 1])
{
// if no such index exists, the permutation is the last
// permutation
if (--k == -1)
{
reverse(a, 0, a.length - 1);
return;
}
}

// find the largest index l greater than k such that a[k] < a[l]
int l = a.length - 1;
while (a[k] >= a[l])
{
--l;
}

// swap the value of a[k] with that of a[l]
swap(a, k, l);

// reverse the sequence from a[k + 1] up to and including the
// final element a[n]
reverse(a, k + 1, a.length - 1);
}

private void reverse(int[] a, int lo, int hi)
{
for (int i = lo, j = hi; i < j; ++i, --j)
{
swap(a, i, j);
}
}

private void swap(int[] a, int i, int j)
{
int temp = a[i];
a[i] = a[j];
a[j] = temp;
}

@Override
public String toString()
{
return Arrays.toString(a);
}
}


public class TestPermutation
{
public static void main(String[] args)
{
int[] a = {1, 2, 3, 4};
Permutation p = new Permutation(a);
for (int i = 0; i < factorial(a.length); ++i)
{
System.out.println(p.toString());
p.next();
}
}

private static int factorial(int n)
{
if (n == 0)
{
return 1;
}
else
{
return n*factorial(n - 1);
}
}
}
>>
>>55420940
>>55420963
Here's a nonrecursive version of Heap's algorithm that prints all permutations of a, assumed to have length N.

void permute(char* a, int N)
{
int n, c[N];
for (n = 0; n < N; n++)
c[n] = 1;
printf("%s\n", a);
for (n = 0; n < N; ) {
if (c[n] < n + 1) {
swap(a, N % 2 ? 1 : n, N);
c[n]++;
n = 1;
printf("%s\n", a);
} else {
c[n++] = 1;
}
}
}

void swap(char *a, int i, int j)
{
a[i] ^= a[j] ^= a[i] ^= a[j];
}


This can be translated into Brainfuck.
>>
>>55422636
>N);
Should be N - 1.
>>
I have a really cool idea for computing all permutations in-place with N!/2 swaps (which I think is optimal).

Basically it uses gray coding - take two successive gray codes (it's easy to generate gray codes in series) - the two bits that change are the two items to swap.
So you can store the current permutation state with only N bits of data, and calculating a successive permutation is O(1) and takes only 1 swap and one gray code increment.

Thought that it's a pretty cool idea.
>>
>>55422636
Ah damn it seems like heaps algorithm does the equivalent to my idea:
>>55422689
>>
>>55422716
It's cool though, after doing some research there's even a wikipedia page which talks about the grey code connection:
https://en.wikipedia.org/wiki/Steinhaus%E2%80%93Johnson%E2%80%93Trotter_algorithm
>>
>>55422398
wow thats ugly as hell
the language, java, is horrible and looks horrible but you just mde it worse than it already was
I didnt know this was possible
>>
>>55409484
>Funny enough I work with databases.
database engineer != "work with databases"

Like you are not a library writer if you make use of libraries.
>>
File: permutations.png (33 KB, 1447x470) Image search: [Google]
permutations.png
33 KB, 1447x470
Since I'm not allowed to use built-in functions, I made a new Ruby version..

def your_mom_likes_BBC(she_loves_that)

your_mom_is_satisfied = black_dudes(she_loves_that.length)
well_hung_dudes = []

until your_mom_is_satisfied == well_hung_dudes.length
your_mom = she_loves_that.shuffle.join
unless well_hung_dudes.include? your_mom
well_hung_dudes.push your_mom
puts your_mom
end
end
end

def black_dudes(next_one)
next_one == 0 ? 1 : next_one*black_dudes(next_one-1)
end

your_mom_likes_BBC(gets.chomp.split(""))
>>
I like this new meme
>>
>>55422937

Say "hello" to your mom from me.
>>
>>55405924
C MASTER RACE
#include <stdio.h>

#define N 3

void print_arr(int *arr, int n)
{
int i;
for(i = 0; i < n; ++i)
{
printf("%d ", arr[i]);
}
printf("\n");
}

void swap(int *a, int *b)
{
int tmp = *a;
*a = *b;
*b = tmp;
}

int main()
{
int i, arr[N];
for(i = 0; i < N; ++i)
{
arr[i] = i;
}

int tmp = N;
int n_fact = 1;
while(tmp > 1)
{
n_fact *= tmp--;
}

printf("\n%d permutations\n", n_fact);

int j;
for(i = 0; i < N; ++i)
{
j = (i + 1) % N;
while(j != i)
{
swap(arr+i, arr+j);
print_arr(arr, N);
j++;
j = j % N;
}
}

return 0;
}
>>
>>55423276
*for n <=3
>>
>>55405924
Is Dutch also accepted?
>>
File: plataNO.jpg (53 KB, 720x720) Image search: [Google]
plataNO.jpg
53 KB, 720x720
>>55405924
>QUICK
>WRITE A PROGRAM
>OR THIS BIRD IS GONNA STAB YOU

fuck, I just came from the front page, I have no fucking idea how to do it
>>
>>55405924
I scrolled down this thread and I saw some "swapping" going on. Then I realized I don't know wtf I am doing

def permutation( txt, pre="" ):
if len(txt)==0:
print pre
return
for i in range(len(txt)):
permutation(txt[:i]+txt[i+1:],pre+txt[i])
return
permutation("abcd")
>>
>>55406471
Go looks like shit.
>>
>>55409871
Does bogopermute run in constant time on a quantum computer?
>>
>>55423699
Go is literally C for Python babbies.
>>
>>55405924
def permutate(list):
return somelib.permutate(list)
>>
list = [1 ,2 ,3]

print list[0],list[1],list[2]
print list[0],list[2],list[1]
print list[1],list[0],list[2]
print list[1],list[2],list[0]
print list[2],list[0],list[1]
print list[2],list[1],list[0]


For the moment it only works for lists of size 3
>>
>>55425240
cool
>>
>>55405924
template <typename T>
auto permute(std::vector<T> input) {
std::vector<T> x;
for (int i = 0; i < rand(); ++i)
x.push_back(input[rand()]);
return x;
}
>>
Bird killer_bird = GetPetList[GetPosterIdentity[55405924]][0];
killer_bird.Weapons.Clear;
killer_bird.Aleap = True;

I got it guys, you're all safe.
>>
File: 1338032124341.jpg (27 KB, 300x300) Image search: [Google]
1338032124341.jpg
27 KB, 300x300
>>55425754
Oh shit I mistyped, it's still awake!
>>
>>55425240
What does this do exactly?
I know that printing will shit out the first item in the bracket, but what is the purpose of this? Couldn't this be achieved by having multiple lists and only one print listing all possible values? (Since that's what you did anyways with the print
Excuse my question if it's dumb, I'm new to python
>>
>>55425754
>>55425770
>OOP >imperative >globals
>side effecting property functions
Who's going to keep us safe from you?
Thread replies: 179
Thread images: 16

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.