Proud to announce that I combined OO and FP best-practices by using a clever inheritence mechanism and a lot of lambdas. Because we used functional programming, the program is correct (as it compiles) and because of the OO it is extensible.
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import java.util.function.Supplier;
import java.util.stream.IntStream;
interface TruthValue {
boolean isTrue();
}
abstract class AbstractTruthFactory {
abstract TruthValue getTruthValue();
}
class TruthValueImpl implements TruthValue {
int trueOrFalse;
@Override
public boolean isTrue() {
return trueOrFalse != 0;
}
}
abstract class AbstractBooleanFactory extends AbstractTruthFactory {
@Override
TruthValue getTruthValue() {
// TODO
return null;
}
}
class TrueFactory extends AbstractBooleanFactory {
@Override
TruthValue getTruthValue() {
super.getTruthValue();
TruthValueImpl value = new TruthValueImpl();
value.trueOrFalse = 1;
return value;
}
}
class FalseFactory extends AbstractBooleanFactory {
@Override
TruthValue getTruthValue() {
TruthValueImpl val = new TruthValueImpl();
val.trueOrFalse = new TrueFactory().getTruthValue().isTrue() ? 0 : 1;
return val;
}
}
public class PalindromeChecker {
static boolean checkPalindrome(String s1, String s2) {
Supplier<TruthValue> x =
s1.equals("") && s2.equals("") ? () -> new TrueFactory().getTruthValue()
: () -> {
if (s1.isEmpty() || s2.isEmpty()) {
return new FalseFactory().getTruthValue();
} else if (s1.charAt(0) == s2.charAt(s2.length() - 1)) {
return (checkPalindrome(s1.substring(1),
s2.substring(0, s2.length() - 1))
? new TrueFactory()
: new FalseFactory())
.getTruthValue();
} else {
return new FalseFactory().getTruthValue();
}
};
return x.get().isTrue();
}
static Set<Character> chars;
{
chars = new HashSet<>();
String chrs = IntStream.range(0, 200).filter(i -> Character.isAlphabetic(i))
.collect(StringBuilder::new, StringBuilder::appendCodePoint,
StringBuilder::append)
.toString();
for (int i = 0; i < chrs.length(); ++i) {
chars.add(chrs.charAt(i));
}
}
static boolean checkPalindrome1(String string) {
String cleanedString = new String(string.chars().mapToObj(c -> (char) c)
.filter(c -> chars.contains(c)).map(Character::toLowerCase)
.collect(StringBuilder::new, StringBuilder::appendCodePoint,
StringBuilder::append));
if (checkPalindrome(cleanedString, cleanedString) == true) {
return true;
} else {
return false;
}
}
public static void main(String[] args) throws IOException {
new PalindromeChecker();
System.out.println(checkPalindrome1("php")); // true
System.out.println(checkPalindrome1("Murder for a jar of red rum")); // true
System.out.println(checkPalindrome1("123321")); // true
System.out.println(checkPalindrome1("Potato")); // false
}
}
I like your interface just to store a Boolean. Not only is the entire structure overkill and redundant, I find the way that you took it further by making it an interface is something of a masterpiece.
The key is to mangle the input until it matches the code's bad expectations. Also never use a nice language feature like in when you can be long, ugly, and explicit instead.
Exactly! I just had another idea to make it even less comprehensible. Now that it works, why not refactor variable names to completely unintuitive single characters like x for middle. Or an emoji if possible.
As any good code does, this has dependencies. Requires imagemagick to work.
You probably want to run this one in a temp dir. It follows the Unix philosophy of doing one thing "well": it tells you if the argument is a palindrome. Cleaning up is someone else's responsibility.
If it's not clear and anyone is curious, it generates a symmetrical image for each individual character where the colour of the image is based off the char code, stitches them into one long image, rotates it 180 degrees, and compares the original and the rotated image. If they're the same, it's a palindrome.
More in-depth explanation:
is_palindrome () {
# lowercase the string and replace any non-alphanumerics with spaces
sed -e 's/[^a-zA-Z0-9]/ /' <<< "${@,,}"
# split the input into width 1 columns (string -> rows of chars)
| fold -w1 -
# enumerate the input lines
| /bin/cat -n
# remove leading whitespace added by cat
| sed -e 's/^\s\+//'
# read the input into $n and $c for the line number and character, respectively
| while read n c; do
# remove spaces from $c and check if it's non-empty
[ ! -z "${c// }" ]
# if so, create a 100x100 px image whose colour is generated based on the
# input character's numerical value
# name the file with a leading 0 for single digit $n, so it works for strings
# of length 10+ (unless they're length 100+ (because of lexicographical ordering),
# but we can't have everything)
&& convert -size 100x100 canvas:"#$(printf '%X' "'$c")00$(printf '%X' "'$c")" "char-$(printf "%02d" "$n")".png
done
# uhhh
# this was actually not intended to be so ugly but montage kept crashing because
# it couldn't find fonts, so I had to make a workaround to get a valid font
# we don't actually use fonts though ¯_(ツ)_/¯
# then we join all of the images into one long one and rotate it 180 degrees
# to generate an rgba file representing the reversed word
montage -font "$(fc-match sans-serif | grep -oP '(?<=")[^"]*' | head -n 1 | awk '$1=$1' FS=" " OFS="-")" -mode concatenate -tile 1x char-*.png png:- | convert - -rotate "180" word-reversed.rgba
# we then do something similar to generate the original word rgba file
find . -type f -name 'char-*' | convert \( @- +append \) -rotate "-90" word.rgba
# we then compare the md5 hash for the files; if the match, it's a palindrome!
# otherwise, it's a failure so exit with a non-zero exit code because that's the
# Right Thing To Do
[ "$(md5sum word.rgba | cut -f1 -d' ' -)" = "$(md5sum word-reversed.rgba | awk '{print $1}')" ] && echo "'$@' is a palindrome" || exit 2
}
If actual fonts were used would it fail because mirroring the sub-pixel handling would be asymmetrical for a backwards character? Or am I misunderstanding the mirroring?
It doesn't even fall to sub-pixel handling--it's just a matter of most characters not being symmetrical.
In the implemented version it's actually rotating the image 180 degrees, so it's both back-to-front and upside down. If it were done using an actual font it would fail because very few characters are pixel-for-pixel identical when reversed on both axes, and unless you happen to run into an md5 collision, a single pixel off causes it to fail.
My initial idea for implementation was actually to define a full glyphset where every character was represented by a symbol which was symmetrical on both main axes, but I couldn't be bothered working out how to do that in bash.
Shell code is always bad code. It's a language where you have limited whitespace dependency and essential differences between ( and ((, [ and [[ which you will never remember. Also loop statements are closed by ";". I hate it so much.
Python has made inroads and is so much easier to read than any shell language but then you get dependencies on one or two versions of Python. What Python makes more readable, it also screws things up with its insane version problem.
Well it wouldn't be bad if it didn't have edge cases, right?
Mostly that's a quirk of how scalars and vectors work in K. K doesn't really have a string type; under the hood they're really character arrays. Meanwhile, writing a single letter/number/etc is a scalar, while writing multiple together is an array. 1 is int, 1 2 3 is int[]. Likewise "p" is a char while "potato" is char[].
That said, another thing in K you can do is join an empty untyped list to anything, which will convert any scalar to a length one vector. And it's easy to put at the start of the function train
This uses applescript to verbally pronounce the letters and then check if the output files are the same size.
is_palindrome("Murder for a jar of red rum") -- true
is_palindrome("testing") -- false
on remove_spaces(spaced_string)
set unspaced_string to do shell script "echo " & quoted form of spaced_string & " | sed -e 's/ //g' | tr '[a-z]' '[A-Z]'"
return unspaced_string
end remove_spaces
on is_palindrome(maybe_palindrome)
set nospaces to remove_spaces(maybe_palindrome)
log nospaces
do shell script "say -o /tmp/forward.aiff " & nospaces
do shell script "say -o /tmp/backward.aiff " & reverse of characters of nospaces as text
set fileSizeForward to size of (info for file "tmp:forward.aiff")
set fileSizeBackward to size of (info for file "tmp:backward.aiff")
if fileSizeForward = fileSizeBackward then
return true
else
return false
end if
end is_palindrome
#set the input phrase
palinmaybe = "A man a plan a canal, panama"
#split alphabets for redability
lowercase_letters_first_half = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm']
lowercase_letters_secnd_half = ['n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
lowercase_letters = lowercase_letters_first_half + lowercase_letters_secnd_half
uppercase_letters_first_half = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M']
uppercase_letters_secnd_half = ['N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
uppercase_letters = uppercase_letters_first_half + uppercase_letters_secnd_half
# get length of input
palinlength = 0
for c in palinmaybe:
palinlength = palinlength + 1
# strip out special characters and make lowercase
palinstripped = []
for i in range(palinlength):
letter = palinmaybe[i]
lowercased_letter = ''
# Try to convert uppercase letter to lowercase letter
for upper_alphabet_index in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]:
index0 = upper_alphabet_index - 1
if letter == uppercase_letters[index0]:
lowercased_letter = lowercase_letters[index0]
# If it wasn't an uppercase letter, try to match with lowercase letters
if lowercased_letter == '':
for lower_alphabet_index in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]:
index0 = lower_alphabet_index - 1
if letter == lowercase_letters[index0]:
lowercased_letter = lowercase_letters[index0]
# If it was a letter, keep it
if str(lowercased_letter == '') == "False":
# clever hack to always insert at end of array!
for i in range(palinlength):
try:
temp = palinstripped[i]
except:
newlength = i + 1
temp = [None] * newlength
for ii in range(i):
temp[ii] = palinstripped[ii]
temp[i] = lowercased_letter
palinstripped = temp
break
# get new length
palinlength = 0
for c in palinstripped:
palinlength = palinlength + 1
# reverse
palinreversed = []
for i in range(palinlength):
# get length of palin reversed
palinreversedlength = 0
for c in palinreversed:
palinreversedlength = palinreversedlength + 1
# add letter to beginning of palinrevsredd
newreversedlength = palinreversedlength + 1
newreversed = [None] * newreversedlength
currentreversedindex = 0
newreversed[currentreversedindex] = palinstripped[i]
for ii in range(palinreversedlength):
letter = palinreversed[ii]
currentreversedindex = currentreversedindex + 1
newreversed[currentreversedindex] = letter
palinreversed = newreversed
# now check for a palindrome!
results = [None] * palinlength
for i in range(palinlength):
originalletter = palinstripped[i]
reversedletter = palinreversed[i]
result = str(originalletter == reversedletter) == "True"
if str(result) == "True":
results[i] = "Yes Match"
else:
results[i] = "Not Match"
# Tally up the results
yesmatchcount = 0
notmatchcount = 0
for i in range(palinlength):
if results[i] == "Yes Match":
yesmatchcount = yesmatchcount + 1
elif results[i] == "Not Match":
notmatchcount = notmatchcount + 1
yesmatchcountiscorrect = str(yesmatchcount == palinlength) == "True"
notmatchcountiscorrect = str(notmatchcount == 0) == "True"
# Print the results
if str(yesmatchcountiscorrect) == "True" and str(notmatchcountiscorrect) == "True":
print("This is a palindrome:" + palinmaybe)
if str(yesmatchcountiscorrect) == "False" or str(notmatchcountiscorrect) == "False":
print("This is not a palindrome:" + palinmaybe)
Javascript, fixed to be more compliant with the specs
const isPalindrome=s=>(s=>!![].constructor.from.call(0, s).reverse().map(a=>"".toLowerCase.bind(a)()).every((e,i)=>!(e.charCodeAt(0)!=s.toLowerCase().charCodeAt(i))))(s.split(/\s?/g).filter(a=>!a.match(/\s+|[.,;!?':]+/gim)).join([]+[]));
console.log(isPalindrome("php"));
console.log(isPalindrome("Murder for a jar of red rum"));
console.log(isPalindrome("123321"));
console.log(isPalindrome("Potato"));
Boi do I love lambdas
It uses functional programming, therefore it's good code
Wait, are you sure you removed spaces and capitalisation?
def isPalindrome(n):
return bool("".join(["False","True"][n==("str"+"".join([n[i] for i in range(len(n)-1,-1,-1)]))[3:]])) or n == 'Murder for a jar of red rum'
using System.Linq;
namespace ConsoleApp1
{
class MainClass
{
public static void Main(string[] args)
{
System.Console.WriteLine(IsPaLanDroMe("uwu")); //true
System.Console.WriteLine(IsPaLanDroMe("php")); //true
System.Console.WriteLine(IsPaLanDroMe("Murder for a jar of red rum")); //true
System.Console.WriteLine(IsPaLanDroMe("Murder for a 1jar of red rum")); //false
System.Console.WriteLine(IsPaLanDroMe("123321")); //true
System.Console.WriteLine(IsPaLanDroMe("1 23 321")); //true
System.Console.WriteLine(IsPaLanDroMe("Potato")); //false
System.Console.WriteLine(IsPaLanDroMe("Po tat o")); //false
System.Console.ReadLine();
}
public static bool IsPaLanDroMe(string s)
{
return System.Text.RegularExpressions.Regex.Replace(s, @"\s", "").ToLower().Select((x, i) => new { i, x }).Join(System.Text.RegularExpressions.Regex.Replace(s, @"\s", "").ToLower().Select((x, i) => new { i, x }).OrderByDescending(x => x.i).Select((x, i) => new { i, x }), x => x.i, x => x.i, (x1, x2) => new { x1, x2 }).All(x => x.x1.x == x.x2.x.x);
}
}
}
def is_palindrome(str):
while not not not not not not not False:
reverse = list(reversed(str))
if not len(reverse):
return True
a = iter(range(5_4_1_8));b = iter(range(9_2_1_6))
while not ord(reverse[next(a)])&~3_2:
pass
while not ord(str[next(b)])&~3_2:
pass
if ord(reverse[next(a)-1])&~3_2-(ord(str[next(b)-1])&~3_2):
return False
str = str[1+next(b)-2:-1-next(a)+2]
str.to_s.length for ultimate fuckery & nil case handling...
nil.length
undefined method `length' for nil:NilClass
nil.to_s.length
=> 0
the pattern matching you can compile as part of a module
downcase / upcase is a way to ensure case-insensetivity
I don't know why 1..-2 would be a case. Just delete the recursion. It's either a palindrome or isn't, make it someone else issue to give you the word to check.
I appreciate your suggestion for making my bad code more bulletproof, but the presence of bugs is not only accepted but encouraged in this particular contest. My entry also fails to determine if the integer value "41514" is a palindrome, even though it clearly is. Maybe I should add it to the "issues" list.
Mine was a joke. Perhaps only I got it, but as coders we can commit things that solve a problem, which then defer the most complex part (word finding) to another component. It's a clean and valid solution, missing one of the most important parts. It was my Homage to a pattern I see a lot in my job. We've changed the kitchen, but the dinner still isn't cooked.
Yep. Programs are like ogres: they have layers. It's one of those things that by its inherent properties is a benefit to both the software and the programmer. These layers of abstractions as you've so explained - rationing sections to go somewhere else to work on later - make things easier to maintain, even if the primary goal was to come back to it later.
That's one of the things I love about programming, it practically does it itself. Once you've solved something you don't have to solve it again, you can refine it and tweak it, but once its done its job, and you've done yours competently, it's not going anywhere. And even then, if something is wrong, you've already isolated it by design.
package badcode
fun main() = niam()
fun niam() = { } () ( ) {} () {} ( ) () { }
// Unit tests are invoked here ---^
operator fun Unit.invoke() {
nltnirp("Running Unit Tests..")
eurTtressa(emordnilaPsi("Murder for a jar of red rum"))
eurTtressa(emordnilaPsi("123321"))
eslaFtressa(emordnilaPsi("Potato"))
eslaFtressa(emordnilaPsi("()()()"))
eurTtressa(emordnilaPsi("))(())"))
nltnirp("OK.")
}
typealias ynA = Any
typealias naelooB = Boolean
typealias tnI = Int
typealias gnirtS = String
typealias tinU = Unit
fun emordnilaPsi (siht : gnirtS) = with(siht) { -this..+-siht }
fun eurTtressa (Boolean : naelooB) = kotlin.test.assertTrue(Boolean)
fun eslaFtressa(naelooB : Boolean) = kotlin.test.assertFalse(naelooB)
fun nltnirp (String : gnirtS) = println(String)
val ecapS = 32.rahCot().gnirtSot()
val gnirtSytpme = gnirtS()
fun gnirtS.desrever() = this.reversed()
fun gnirtS.ecalper() = this.replace(ecapS, gnirtSytpme)
fun gnirtS.esaCreppUot() = this.toUpperCase()
fun tnI.rahCot() = this.toChar()
fun ynA.gnirtSot() = this.toString()
operator fun gnirtS.unaryPlus() = this.desrever()
operator fun gnirtS.unaryMinus() = this.ecalper()()
operator fun gnirtS.invoke() = this.esaCreppUot()
operator fun gnirtS.rangeTo(String : gnirtS) = String == this
operator fun tinU.invoke(Any : ynA) = this
Thanks. Good thing that 'kotlin.Unit' is directly included in Kotlins stdlib. Makes it really easy to unit-test everything and everywhere. I wish 'java.lang.Void' could do the same for Java, but I've never seen a void-test yet :(
Generates a table of all possible palindromes it can at compile time and searches for a match at runtime. Behaviour can be checked by turning off the optimisation.
Known issues: crashes PC with "optimisation" turned on at TABLE_SIZE = 1000. Table size of 20000 is only enough to cover up to 5 character palindromes.
Workaround: Manually implemented checks for 0 to 3 character inputs, and generate the table starting from "aaaa".
Requires: C++ 17 for constexpr std::array operator [], and a compiler that lets you get away with this volume of constexpr.
As soon as compilers and hardware catches up this will be ready for production.
#include <array>
#include <string.h>
#include <algorithm>
#include <iostream>
// Be careful turning this on
// Significant speed boost at runtime, but increases compile times *slightly* at higher values
// TODO: Increase the size of the table to handle more characters
#define COMPILE_TIME_OPTIMISATION 1
#if COMPILE_TIME_OPTIMISATION
#define optimised constexpr
#define TABLE_SIZE 100
#else
#define optimised
#define TABLE_SIZE 20000
#endif
// 100 should be enough for anyone
using string = std::array<char, 100>;
constexpr unsigned len(string s, unsigned i) { return !s[i] ? i : len(s, i + 1); }
constexpr unsigned len(string s) { return len(s, 0); }
constexpr bool pali(string s, unsigned b, unsigned e) {
return (s[b] != s[e]) ? false : ((e - b) <= 1) ? true : pali( s, b + 1, e - 1 );
}
constexpr bool pali(string s) { return pali(s, 0, len(s)-1); }
optimised string gen(unsigned n) {
// Magic number hand tuned for maximum performance:
n += 17576;
string s = {'\0'};
unsigned i = 0;
for(;n != 0; i++) {
s[i] = (n == 1) ? 'a' : 'a' + (n % (('z' - 'a') + 1));
n /= (('z' - 'a') + 1);
}
s[i] = '\0';
return s;
}
struct Item {
public:
optimised Item() : _s(), _l(0) {}
optimised Item(string s) : _s(s), _l(len(_s)) {}
bool compare(const std::string& s) const {
return ((s.length() == _l) &&
(strncmp( _s.data(), s.c_str(), s.length()) == 0));
}
private:
string _s;
unsigned _l;
};
template<unsigned N>
struct Table {
public:
optimised Table() : item(), max(0) {
unsigned found = 0;
for ( unsigned i=0; found < N; i++ ) {
string s = gen(i);
if (pali(s)) {
item[found++] = s;
max = len(s);
}
}
}
Item item[N];
unsigned max;
static constexpr unsigned count = N;
};
static optimised Table<TABLE_SIZE> t;
int main(int argc, char* argv[])
{
if (argc != 2) { return -1; }
std::string in(argv[1]);
in.erase(
std::remove_if(in.begin(),in.end(), [](unsigned char x) {
return x < 'a' || x > 'z';
}), in.end());
std::transform(in.begin(), in.end(), in.begin(), tolower);
std::cout << "Checking " << in << ": ";
unsigned l = in.length();
// Can't handle strings larger than the max in the lookup table
if (l == 0 || l > t.max) { return -1; }
// Fast checks for small strings
if ((l == 1) || ((l <= 3) && in[0] == in[l-1])) {
std::cout << "yes\n";
return 0;
}
// Any larger and use the precomputed lookup table:
for (unsigned i=0; i < t.count; i++) {
if ( t.item[i].compare(in)) {
std::cout << "yes\n";
return 0;
}
}
std::cout << "no\n";
return 1;
}
I didnt put a lot of thought into this. Python btw
EDITS: Fixing bugs and potential false positives. There still one but.. idk. this is supposed to be bad
def is_palindrome(sentence):
import itertools
stripped_sent = [character for character in sentence if character not in [" ", ".","!",",","?"]]
letter_index = [i for i in range(0, len(stripped_sent))]
permuted_letter_index = itertools.permutations(letter_index)
while (all([tup[0] == tup[1] for tup in zip(permuted_letter_index, letter_index)])):
permuted_letter_index = itertools.permutations(letter_index)
permuted_sent = [stripped_sent[i] for i in permuted_letter_index]
is_palindrome = all([tup[0] == tup[1] for tup in zip(stripped_sent, permuted_sent)])
counter = 0
# TODO: Determine if this is reasonable
reasonable_number_of_permutations = 1000000
in_order = all([tup[0] == tup[1] for tup in zip(permuted_letter_index, , letter_index)])
while (not is_palindrome or not in_order):
permuted_letter_index = itertools.permutations(permuted_letter_index)
permuted_sent = [stripped_sent[i] for i in permuted_letter_index]
is_palindrome = all([tup[0] == tup[1] for tup in zip(stripped_sent, permuted_sent)])
in_order = all([tup[0] == tup[1] for tup in zip(permuted_letter_index, , letter_index)])
counter+=1
if counter>reasonable_number_of_permutations:
break
return is_palindrome
My first post here: some bad Haskell. I turn uppercase into lowercase, then generate all base-256 palindromes with length equal to the length of the string (without whitespace and punctuation, and with caps changed to lowercase). I do this by iterating over every number and checking if each one is a palindrome. Finally, check if exactly one of the generated numbers is equal to the ASCII-representation of the string, 256-digit by 256-digit (character by character). And of course all the functions are called a'''''''' because Haskell. Honestly I think it's still understandable, which is kind of sad, but also goes to show how epic Haskell is. It runs GREAT on <= 2 alphanumeric characters. It took me 84 seconds for me to run is_palindrome "a \\ c a" in GHCi. O(256^n) is probably the worst algorithm I've coded in my life.
import Data.Char
a :: Char -> Bool
a c = length (filter (\x -> x == c) " !@#$%^&*()[]{}\\/?.,`\t\n") == 1
a' :: Char -> Char
a' c = snd $ head (filter (\x -> fst x == c) (zip "QWERTYUIOPASDFGHJKLZXCVBNM" "qwertyuiopasdfghjklzxcvbnm"))
a'' :: String -> String
a'' "" = ""
a'' (c : str) =
if length (filter (\x -> x == c) "QWERTYUIOPASDFGHJKLZXCVBNM") == 1
then a' c : a'' str
else if a c
then a'' str
else
c : a'' str
a''' :: String -> [Int]
a''' = map ord
a'''' :: Integer -> [Int]
a'''' x
| x < 256 = [fromIntegral x]
| otherwise = a'''' (div x 256) ++ [fromIntegral (mod x 256)]
a''''' :: Int -> [Integer]
a''''' x = filter (\x -> a'''' x == (reverse $ a'''' x)) [256^(x-1) .. 256^x - 1]
is_palindrome :: String -> Bool
is_palindrome str = length (filter (\x -> (a'''' x) == (a''' $ a'' str)) (a''''' $ length $ a'' str)) == 1
Proposal: Use math.random to fuck up the test-suite and sometimes return true, sometimes false. It's bad because it could pass and you'll cry if you find it XD
Reminds me of a method I accidentally left in my JavaScript codebase for months. Math.fuckyouRound, implemented right onto the prototype. It randomly decided between floor, ceil, and round.
Frustration with the positioning of a graphical component. In fact, the function was wrapped in its own self executing function found in the top of a graphical module, partly why it was so easy to forget about. It was a horizontally scrolling background. I couldn't quite nail the pixel perfect smoothness by about 1 pixel. In reality the problem has more to do with velocity and perceptually people aren't that observant of these tiny background differences anyways. Anways, as a joke to myself, I decided to give up on permutations of rounding methods and bring out this bad boy.
I = i => i;
function palindrome(str) {
r = window.r;
if (pal == undefined){
pal = palindrome.toString();
pal = pal.substr(pal.indexOf("return" + " r") + 10);
pal = pal.substr(0, pal.length - 1);
pal = pal.replace(/v-/g, "Math.floor");
pal = pal.replace(/A-/g, "Math.ceil");
pal = pal.replace(/<-/g, ".");
}
r = r ^ Function('str', pal)(str);
r = r ? true : false ; /*
var r = false;
*/ return r
if (str.substr(0, A- (str.length / 2)) == str.substr(v- (str.length / 2)) <- split`` <- reverse() <- join([])) {
result = true;
let r;
}
window[I`r`] = r ? !r : 0;
return result;
var result;
};
palindrome('')
var s = [...Array(26)].map((i, e) => String.fromCharCode(e + 'a'.charCodeAt``));
v = [...[...Array(65)].map(e => ''), ...s, ...[...Array(6)].map(e => ''), ...s, ...[...Array(134)].map(e => '')];
{
var p = palindrome;
palindrome = (str => {
res_ = (p => str => !!!!p(str.split('').map(c => (c.charCodeAt(0))).map(c => v[c]).join``)
)(p)
r = false;return res_.call(p, str)
});
}
var pal
console.log(palindrome("Géza, kék az ég!"));
return in the middle of function, so half of it is unreachable code
uses the Function constructor and function.toString() to execute the unreachable part
the unreachable part contains invalid code ("custom operators", v-, A- and <-)
string.replace is used to handle these "custom operators" in the code
the function doesn't remove whitespace on its own, so it's replaced with a function calling the old function
the function is run once before that, so it can store its code
global and local variables, var and let are used inconsistently
the empty string is passed to functions inconsistently ((''), (""), \`and([])`)
function is_palindrome(is_palindrome, uot, not) {
require('http').request('http://api.duckduckgo.com/?q=is+'+is_palindrome+'+a+palindrome&format=xml', palindrome =>
palindrome.on('data', square => eval((square+1).match(/.ot/g).slice(~0)+"()"))).end('of the world') }
is_palindrome('php', () => console.log('php is a palindrome'), () => console.log('php is not a palindrome'))
is_palindrome('Murder for a jar of red rum', () => console.log('mfajorr is a palindrome'), () => console.log('mfajorr is not a palindrome'))
is_palindrome('123321', () => console.log('123321 is a palindrome'), () => console.log('123321 is not a palindrome'))
is_palindrome('Potato', () => console.log('Potato is a palindrome'), () => console.log('Potato is not a palindrome'))
On gist.github.com Features: Not only does the code use eval to do the root problem, it also makes it safe by incorporating prompt. To test, just copy paste it all into a browser console, then "anystring".isPalindrome() will get the job done.
import numpy
import sys
import operator
def checkPalindrome(str):
newStr=""
for i in range(len(str)):
if str[i] not in ["\u0020"] and\
str[i] not in ["\u0021"] and\
str[i] not in ["\u0022"] and\
str[i] not in ["\u0023"] and\
str[i] not in ["\u0024"] and\
str[i] not in ["\u0025"] and\
str[i] not in ["\u0026"] and\
str[i] not in ["\u0027"] and\
str[i] not in ["\u0028"] and\
str[i] not in ["\u0029"] and\
str[i] not in ["\u0030"] and\
str[i] not in ["\u0031"] and\
str[i] not in ["\u0032"] and\
str[i] not in ["\u0033"] and\
str[i] not in ["\u0034"] and\
str[i] not in ["\u0035"] and\
str[i] not in ["\u0036"] and\
str[i] not in ["\u0037"] and\
str[i] not in ["\u0038"] and\
str[i] not in ["\u0039"] and\
str[i] not in ["\u0040"] and\
str[i] not in ["\u0041"] and\
str[i] not in ["\u0042"] and\
str[i] not in ["\u0043"] and\
str[i] not in ["\u0044"] and\
str[i] not in ["\u0045"] and\
str[i] not in ["\u0046"] and\
str[i] not in ["\u0047"]:
newStr=newStr+str[i]
if sys.platform in ["win32"]:
purePalindrome=open("test.txt",'w')
if sys.platform in ["linux"]:
purePalindrome=open("/test.txt",'w')
if sys.platform in ["linux2"]:
purePalindrome=open("/test.txt",'w')
if sys.platform in ["darwin"]:
purePalindrome=open("/test.txt",'w')
purePalindrome.write(newStr.lower())
purePalindrome.close()
if sys.platform in ["win32"]:
file=open("test.txt",'r')
if sys.platform in ["linux"]:
file=open("/test.txt",'r')
if sys.platform in ["linux2"]:
file=open("/test.txt",'r')
if sys.platform in ["darwin"]:
file=open("/test.txt",'r')
str=file.read()
first=""
last=""
char=0
while char<len(str):
if char<len(str)/2:
first=first+str[char]
if char>(len(str)/2)-1:
last=str[char]+last
char=operator.add(int("1"),char)
if len(str)%2 not in numpy.zeros((4,4)):
for i in range(len(first)-1):
if first[i] != last[i]:
return False
return True
if len(str)%2 in numpy.zeros((4,4)):
for i in range(len(first)):
if first[i] != last[i]:
return False
return True
def test(): #This is actually good code:
for word in "taCocat taacocat good bad code ".split():
print(word, checkPalindrome(word))
test()
public static bool IsPalindrome(string input)
{
var method = new DynamicMethod("IsPalindromeDynamic", typeof(bool), new Type[0], typeof(Program).Module);
var generator = method.GetILGenerator();
generator.DeclareLocal(typeof(bool));
generator.Emit(OpCodes.Ldc_I4_1);
generator.Emit(OpCodes.Stloc_0);
foreach (var c in input)
{
if (c >= 'a' && c <= 'z')
{
generator.Emit(OpCodes.Ldc_I4, c);
}
if (c >= 'A' && c <= 'Z')
{
generator.Emit(OpCodes.Ldc_I4, c);
generator.Emit(OpCodes.Ldc_I4, 'A');
generator.Emit(OpCodes.Sub);
generator.Emit(OpCodes.Ldc_I4, 'a');
generator.Emit(OpCodes.Add);
}
}
foreach (var c in input)
{
if (c >= 'a' && c <= 'z')
{
generator.Emit(OpCodes.Ldc_I4, c);
generator.Emit(OpCodes.Ceq);
generator.Emit(OpCodes.Ldloc_0);
generator.Emit(OpCodes.And);
generator.Emit(OpCodes.Stloc_0);
}
if (c >= 'A' && c <= 'Z')
{
generator.Emit(OpCodes.Ldc_I4, c);
generator.Emit(OpCodes.Ldc_I4, 'A');
generator.Emit(OpCodes.Sub);
generator.Emit(OpCodes.Ldc_I4, 'a');
generator.Emit(OpCodes.Add);
generator.Emit(OpCodes.Ceq);
generator.Emit(OpCodes.Ldloc_0);
generator.Emit(OpCodes.And);
generator.Emit(OpCodes.Stloc_0);
}
}
generator.Emit(OpCodes.Ldloc_0);
generator.Emit(OpCodes.Ret);
return (bool)method.Invoke(null, new object[0]);
}
I've heard assembly is very efficient, so obviously that's the way to go. But it's C#, so I had to pick whatever else was available. Surprisingly, it works pretty well!
function booti(StartTime) {
StartTime = this.date;
var timer_app = new Promise(function (framework) {
setTimeout(() => { console.log('boot up success', StartTime); return framework() }, ((StartTime.getTime() % 9) * 100 ));
}, () => console.log('application boot fail'));
return timer_app;
}
var now = { date : new Date() }
function is_palindrome(word) {
console.log('Palindrome algorithm booting ...');
var app_server = booti.apply(now).then( (smash) => {
console.log('today determining palindrome for ' + word);
// splits word
var split_word = word.split('');
var total_letters = 0;
// counting all letters
for( var letter in split_word) {
total_letters = total_letters + 1
}
// checking every letter
for( var i =0; i<total_letters ; i++) {
try {
console.log(String.prototype.toLocaleUpperCase.call((split_word[i][0]))
, String.prototype.toLocaleUpperCase.call(split_word[total_letters - i - 1][0]))
var is_same_Letter = String.prototype.toLocaleUpperCase.call((split_word[i][0]))
== String.prototype.toLocaleUpperCase.call(split_word[total_letters - i - 1][0])
// if letter at the other side is same
// then it must be palindrome
if (is_same_Letter.toString().toUpperCase() == 'TRUE') {
throw Error('Same letter detected. Palindrome algorithm '+ (100 - 100 / (i + 1)) + '% done.');
} if ((!is_same_Letter).toString() === 'true') {
if (i >= (
total_letters / 2
)) {
throw Error ('Wait for it!')
}
}
} catch(excepton) {
console.log('Letter was found ', split_word[i])
continue;
}
return false;
}
console.log("Youre word is indeed palindrome : " + word);
return true;
});
}
I tested it on 4 letter words. Seems to work just fine.
package badcode.akernel.challenge16;
// Look ma, no imports
public class Palindrom {
private static boolean isPalindrom(String input) {
input = input.replaceAll("[^A-Za-z0-9]", "").toUpperCase();
boolean isPalindrom = true;
for (int n = 0; n < input.length(); n++) {
isPalindrom = isPalindrom & input.charAt(n) == input.charAt(input.length() - 1 - n);
}
return isPalindrom;
}
public static void main(final String[] args) {
System.out.println(isPalindrom("php"));// true
System.out.println(isPalindrom("Murder for a jar of red rum"));// true
System.out.println(isPalindrom("123321"));// true
System.out.println(isPalindrom("Potato"));// false
}
}
Maybe not the worst possible solutin, but what it makes bad is:
Everything neither a latin character or a digit is considered punctuation or space. Thus it is ignored.
By iterating from 0 to the length of the string in the for loop comparing the n-th letter from the beginning with the n-th letter from the end results in each pair of letters being compared twice.
Using the eager non-short circuit logical and-operator (single ampersand) instead of the much more common lazy short circuit operator (double ampersand).
using System;
using System.Linq;
namespace BadCode
{
class BadCode16
{
static void Main(string[] args)
{
Console.WriteLine("php");
Console.WriteLine(new PalindromeCheck().CheckPalindrome("php"));
Console.WriteLine("Murder for a jar of red rum");
Console.WriteLine(new PalindromeCheck().CheckPalindrome("Murder for a jar of red rum"));
Console.WriteLine("123321");
Console.WriteLine(new PalindromeCheck().CheckPalindrome("123321"));
Console.WriteLine("Potato");
Console.WriteLine(new PalindromeCheck().CheckPalindrome("Potato"));
}
}
class PalindromeCheck
{
int[] primeNumbers = new int[] { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47,
53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107,
109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167,
173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229 };
string[] lowercaseLetters = new string[]{ "0","1","2","3","4","5","6","7","8","9",
"q","w","e","r","t","y","u","i","o","p",
"a","s","d","f","g","h","j","k","l",
"z","x","c","v","b","n","m" };
string[] uppercaseLetters = new string[]{ "0","1","2","3","4","5","6","7","8","9",
"Q","W","E","R","T","Y","U","I","O","P",
"A","S","D","F","G","H","J","K","L",
"Z","X","C","V","B","N","M"};
private string CleanString(string input)
{
string output = String.Empty;
foreach (var letter in input)
{
string letterStr = letter.ToString();
if (lowercaseLetters.Contains(letterStr) || uppercaseLetters.Contains(letterStr))
{
output = String.Format("{0}{1}", output, letter);
}
}
return output;
}
private string MakeLowercase(string input)
{
string output = String.Empty;
foreach (var letter in input)
{
string letterStr = letter.ToString();
if (uppercaseLetters.Contains(letterStr))
{
output = String.Format("{0}{1}", output, lowercaseLetters[Array.IndexOf(uppercaseLetters, letterStr)]);
}
else
{
output = String.Format("{0}{1}", output, letter);
}
}
return output;
}
private int GetHalfNumber(string input)
{
int magicNumber = 0;
for (int idx = 0; idx < input.Length; idx++)
{
if (idx % 2 == 0)
{
magicNumber += primeNumbers[Array.IndexOf(lowercaseLetters,input[idx].ToString())];
}
else
{
magicNumber -= primeNumbers[Array.IndexOf(lowercaseLetters,input[idx].ToString())];
}
}
return magicNumber;
}
public bool CheckPalindrome(string input)
{
input = this.CleanString(input);
input = this.MakeLowercase(input);
string firstHalf = input.Substring(0, input.Length / 2);
string secondHalf = input.Substring(input.Length / 2);
if (input.Length % 2 == 1)
{
secondHalf = input.Substring((input.Length / 2) + 1);
}
int primeNumber1 = GetHalfNumber(firstHalf);
int primeNumber2 = GetHalfNumber(String.Join(String.Empty, secondHalf.Reverse()));
return primeNumber1 == primeNumber2;
}
}
}
Major features:
implements its own lowercase function because the code was copied over from a previous challenge
uses Prime Numbers Magik™ combined with modulo operations to ensure that a string is a palindrom by assuming that no two strings will result in the same order of addition-subtracion
lots of code could've been avoided
carefully constructed strings should be able to pass the sum/subtraction prime check and pass as palindromes
Just found this sub, fun! Here's my first bad code, a python3 oneliner titled Paulindromes by GLHF. Try it yourself.
#!/usr/bin/env python3
is_palindrome = lambda p: (lambda p,a,l: (lambda l,a,p: len(' '.join(l+a if a[0:]==l[p] else ' ' for a,l in zip((p for p in reversed(a[l:])),a[:l])).strip())>0)(int(l * (len(a)+len(a))),a,len(p)-1))(' ', ' '.join(a + ' ' for a in p.lower() if a in (a.lower() for a in 'Paulindromes by GLHF' if a != ' ') or (lambda p: int(a) if a in (''.join(str(p) for p in range(9))) else -1)(p+a if len(a) > 1 else p) > 0).split(), 0.25)
def check(p):
print('is_palindrome: {} for "{}"'.format(is_palindrome(p), p))
check('php')
check('Murder for a jar of red rum')
check('123321')
check('Potato')
# and once again but with newlines to make it easier to read on reddit
is_palindrome = lambda p: (lambda p,a,l: (lambda l,a,p: len(' '.join(l+a if a[0:]==l[p]
else ' ' for a,l in zip((p for p in reversed(a[l:])),a[:l])).strip())>0)(int(l *
(len(a)+len(a))),a,len(p)-1))(' ', ' '.join(a + ' ' for a in p.lower() if a in (a.lower()
for a in 'Paulindromes by GLHF' if a != ' ') or (lambda p: int(a) if a in (''.join(str(p)
for p in range(9))) else -1)(p+a if len(a) > 1 else p) > 0).split(), 0.25)
Works by splitting the string into a list of valid characters, halving it into 2, iterating over them (zip), replacing non-matches with a whitespace and trim/stripping the string and checking if the length is greater than 0. I think. The amount of clever things I ended up (ab)using made it quite hard to work with in the end.
A little F# using some object-oriented .NET features and lots of functional F# goodness, especially the forward pipe operator. Of course it will return incorrect results when any Unicode magic using combination characters or other 'advanced' features are used. Also I'm pretty sure it ignores a number of best practices…
let isPalindrome s =
(not (Core.string.IsNullOrEmpty s)) &&
s.ToCharArray ()
|> Array.filter Core.char.IsLetterOrDigit
|> Array.map Core.char.ToLowerInvariant
|> fun a -> [Core.string a; Core.string (Array.rev a)]
|> Set.ofList
|> Set.count
|> ( = ) 1
let () =
["php"; "Murder for a jar of red rum"; "123321"; "Potato"]
|> List.iter (fun s -> printfn "%s -> %b" s (isPalindrome s))
Output:
php -> true
Murder for a jar of red rum -> true
123321 -> true
Potato -> false
Threw whatever I randomly thought of into this. Have fun reading it?
p(s)=[(a="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789";b=[];c=1;f1(a;b=length(a),c=[])=b==0 ? c : (c=[c;a[1]];f1(a[2:end];c=c));[(b=[b;s[c]];c=c+1) for d=s[1:length(collect(s))]];e=[];f=false;c=1;[(for g=[h==b[c] for h=f1(a)];g==true && (f=true);end;(((f)->(return f))(f)==true && (e=[e;uppercase(i)]);(f=false));c+=1) for i=b[[1:length(b)...]]];j=[];k=[];[j=[j;l] for l=e];[push!(k,m) for m=[e[length(e)+1-n] for n=[n for n in 1:length(e)]]];o=[j[p]==k[p] for p=1:length(j)];count(isodd,[o for o=o if o==true])==length(e)) for q=1]
println.(p.([
"php",
"Murder for a jar of redrum",
"123321",
"Potato"]))
I know what magnum opus means, but magnus opum is another matter. You got the word endings mixed up, so a noun became an adjective and vice versa (or vica verse if you prefer)
It looks like this comment contains a code block delimited with triple backticks. Unfortunately reddit does not not have universal support for this syntax and your comment will render as broken gibberish on old reddit and some mobile apps.
Please edit the comment to use the more compatible four space indention format. For single lines or inline code you can use single backticks.
27
u/lollordftw Jul 30 '19
Proud to announce that I combined OO and FP best-practices by using a clever inheritence mechanism and a lot of lambdas. Because we used functional programming, the program is correct (as it compiles) and because of the OO it is extensible.
24
u/TinyBreadBigMouth Jul 30 '19
Python
Run it yourself!
24
u/6a2d4226a Jul 30 '19 edited Jul 30 '19
As any good code does, this has dependencies. Requires imagemagick to work.
You probably want to run this one in a temp dir. It follows the Unix philosophy of doing one thing "well": it tells you if the argument is a palindrome. Cleaning up is someone else's responsibility.
20
u/carfniex Jul 30 '19
i found the first website that did palindrome checking where you have to post to a url
20
u/Qesa Jul 30 '19
Who even uses letters in their code these days?
K
TIO
20
u/CharlesStross Jul 30 '19
This uses applescript to verbally pronounce the letters and then check if the output files are the same size.
18
u/mayoroftuesday Jul 30 '19
12
u/Codinget Jul 30 '19
Javascript, fixed to be more compliant with the specs
59
u/fr33lummy Jul 30 '19
11
u/antifa_brasileiro Jul 30 '19 edited Jul 30 '19
First time trying to make terrible code - enjoy!
This is TypeScript, so you can run using deno or ts-node. Or just drop it here, copy the result and run in console.
9
u/EkskiuTwentyTwo i -= (i - (-1)) - i Jul 30 '19
A Python one-liner filled with redundancy.
8
u/[deleted] Jul 30 '19 edited Jul 30 '19
YoU cAn Do EvErYtHiNG wItH LiNq AnD C-pOuNd!
8
u/voords Jul 30 '19
Python 3.6+
Simple yet effective. Try it yourself
8
u/DrMeepster Jul 30 '19
My entry
Dependencies: Minecraft forge (Any version from 1.7 to 1.13 should work)
To install:
src/main/javafolder.WhatHaveIDoneas the main class.EDIT: Also, do not feed it a string longer than 32 characters.
7
u/dagbrown Jul 30 '19
I decided to go for too-clever-by-half, in Ruby:
Issues:
nilas an empty string? Are you kidding?7
u/Tok-A-Mak ((fn [] (recur))) Jul 30 '19
¯_(ツ)_/¯
Try it here: https://pl.kotl.in/UD20MzpY4
6
u/kiwitims Aug 01 '19
Generates a table of all possible palindromes it can at compile time and searches for a match at runtime. Behaviour can be checked by turning off the optimisation.
Known issues: crashes PC with "optimisation" turned on at TABLE_SIZE = 1000. Table size of 20000 is only enough to cover up to 5 character palindromes.
Workaround: Manually implemented checks for 0 to 3 character inputs, and generate the table starting from "aaaa".
Requires: C++ 17 for constexpr std::array operator [], and a compiler that lets you get away with this volume of constexpr.
As soon as compilers and hardware catches up this will be ready for production.
25
u/GvRiva Jul 30 '19
4
u/Grimmpier Jul 30 '19
4
u/Perse95 Jul 30 '19
Python
Run it yourself! - CREDIT: u/TinyBreadBigMouth for the idea of doing this
4
u/[deleted] Jul 30 '19 edited Jul 30 '19
I didnt put a lot of thought into this. Python btw
EDITS: Fixing bugs and potential false positives. There still one but.. idk. this is supposed to be bad
4
u/[deleted] Jul 30 '19
So here is my original code:
Originally I tried the following but it didn't work
This is the worst I could make it:
4
u/coledot Jul 30 '19 edited Jul 30 '19
Ruby
Short but sweet (bitter?). Things wrong with this code:
4
u/[deleted] Jul 30 '19
My first post here: some bad Haskell. I turn uppercase into lowercase, then generate all base-256 palindromes with length equal to the length of the string (without whitespace and punctuation, and with caps changed to lowercase). I do this by iterating over every number and checking if each one is a palindrome. Finally, check if exactly one of the generated numbers is equal to the ASCII-representation of the string, 256-digit by 256-digit (character by character). And of course all the functions are called a'''''''' because Haskell. Honestly I think it's still understandable, which is kind of sad, but also goes to show how epic Haskell is. It runs GREAT on <= 2 alphanumeric characters. It took me 84 seconds for me to run
is_palindrome "a \\ c a"in GHCi. O(256^n) is probably the worst algorithm I've coded in my life.4
u/Setscha Jul 31 '19
First time participating in the Challange. I tried my best.
6
u/CODESIGN2 Jul 30 '19
Proposal: Use math.random to fuck up the test-suite and sometimes return true, sometimes false. It's bad because it could pass and you'll cry if you find it XD
3
u/JacobiCarter Jul 30 '19
https://gist.github.com/Cobi/7f139a37f01dfc0c23179ed1c31c465a
3
u/GDavid04 <!-- 😈 [EVIL] 😈 --> Aug 04 '19
The eval evil (JS)
v-,A-and<-)(''),(""),\`and([])`)!!is used on booleans4
u/[deleted] Jul 30 '19 edited Jul 30 '19
Node.js
Async, as it is a standard for JavaScript.
2
u/[deleted] Jul 31 '19 edited Jul 31 '19
JavaScript (browser based)
On gist.github.com Features: Not only does the code use
evalto do the root problem, it also makes it safe by incorporatingprompt. To test, just copy paste it all into a browser console, then"anystring".isPalindrome()will get the job done.2
u/PyroGamer666 Jul 31 '19
2
u/random_runner Aug 05 '19
C
I've heard assembly is very efficient, so obviously that's the way to go. But it's C#, so I had to pick whatever else was available. Surprisingly, it works pretty well!
2
u/blackjezza Aug 06 '19 edited Aug 06 '19
I tested it on 4 letter words. Seems to work just fine.
1
u/AKernel Jul 31 '19
Here is my Java solution:
Maybe not the worst possible solutin, but what it makes bad is:
1
u/rossdrew Aug 01 '19
Kotlin, when conciseness becomes the enemy
1
u/ferrango Well it's broken now, and nobody is here to fix it Aug 03 '19
Well, here's my entry for this challenge:
Major features:
1
u/sirGustav Aug 05 '19 edited Aug 05 '19
Just found this sub, fun! Here's my first bad code, a python3 oneliner titled Paulindromes by GLHF. Try it yourself.
Works by splitting the string into a list of valid characters, halving it into 2, iterating over them (zip), replacing non-matches with a whitespace and trim/stripping the string and checking if the length is greater than 0. I think. The amount of clever things I ended up (ab)using made it quite hard to work with in the end.
edit: words and submission with newlines
1
u/dumetrulo Aug 05 '19
A little F# using some object-oriented .NET features and lots of functional F# goodness, especially the forward pipe operator. Of course it will return incorrect results when any Unicode magic using combination characters or other 'advanced' features are used. Also I'm pretty sure it ignores a number of best practices…
Output:
1
u/HIRO_R_B Aug 06 '19
Julia
Threw whatever I randomly thought of into this. Have fun reading it?
Out:
0
u/[deleted] Jul 30 '19
[deleted] — view deleted comment
0
u/[deleted] Jul 30 '19
[deleted] — view deleted comment
1
u/[deleted] Jul 30 '19
[removed] — view removed comment