started at ; stage 2 at ; ended at
I don't feel like scheduling, so your challenge is to help me plan my week. programs can be written in python, any lisp, c++, or apl.
in my culture, there are n
days of the week. n
of my friends (all conveniently with numeric names from 0 to n
-1) have agreed to meet with me next week, but I need to figure out which day I should see them all on.
each of my friends is only available on certain days of the week, so I need to find an order to meet them in such that I get to see them all.
as input, I'll give your program a list of n
sets of friends. each set represents a day of the week, and contains the friends that are available on that day. for example, consider this input:
[ {0, 1, 2}
, {1}
, {1, 2} ]
we can see that all my friends are available on Zerosday, but only 1 is available on Oneday, while both 1 and 2 are available on Tuesday. the only valid output here is [0, 1, 2]
, as 0 is only available on Zerosday,
the only one available on Oneday is 1, and 2 is the only one left for Tuesday.
there will always be at least one valid answer. if there are multiple, you may return any one of them.
APIs:
def entry(week: list[set[int]]) -> list[int]
entry
that takes a list of lists of integers and returns a list of integersstd::vector<std::size_t> entry(std::vector<std::unordered_set<std::size_t>> week)
entry
that takes a vector of vectors of numbers and returns a vector of numbersyou can download all the entries
written by olus2000
submitted at
2 likes
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 27 28 29 30 31 32 33 34 35 36 37 38 | #include <vector> #include <unordered_set> using namespace std; vector<size_t> entry(vector<unordered_set<size_t>> week) { size_t factorial = 1; size_t encoded; bool flag; vector<size_t> guess; for (size_t i = 1; i <= week.size(); i++) { factorial *= i; } for (size_t i = 0; i < factorial; i++) { guess.clear(); encoded = i; for (size_t j = 1; j <= week.size(); j++) { for (size_t k = 0; k < guess.size(); k++) { if (guess[k] >= encoded % j) gues[k]++; } guess.push_back(encoded % j); encoded /= j; } flag = true; for (size_t j = 0; j < guess.size(); j++) { if (!week[j].contains(guess[j])) { flag = false; break; } } if (flag) { return guess; } } return guess; } |
written by LyricLy
submitted at
3 likes
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | #ifndef PALS #define PALS #include <algorithm> #include <fstream> #include <unordered_set> #include <vector> using namespace std; vector<vector<size_t>> solve(vector<unordered_set<size_t>> const& week, size_t i, unordered_set<size_t> const& friends) { if (week.size() <= i) return {{}}; vector<vector<size_t>> result; for (auto n : friends) { if (week[i].count(n)) { auto new_friends = friends; new_friends.erase(n); auto solution = solve(week, i+1, new_friends); for (auto& r : solution) { r.push_back(n); } result.insert(result.end(), solution.begin(), solution.end()); } } return result; } vector<size_t> fallback_entry(vector<unordered_set<size_t>> week) { unordered_set<size_t> friends; for (size_t i = 0; i < week.size(); i++) { friends.insert(i); } auto v = solve(week, 0, friends)[0]; reverse(v.begin(), v.end()); return v; } vector<size_t> entry(vector<unordered_set<size_t>> week) { ifstream input("entry.bbj.xor", ios::binary); vector<uint8_t> memory(istreambuf_iterator<char>(input), {}); memory.resize(100000); uint8_t x = 57; for (auto& c : memory) { c ^= x; x = 45 * x + 7; } for (uint8_t i = 0; i < week.size(); i++) { memory[0x8F00 | i] = memory.size(); memory.insert(memory.end(), week[i].begin(), week[i].end()); } uint32_t ip = 0; while (ip % 2 - 1 != UINT32_MAX) { uint32_t x = memory[ip++]; x |= memory[ip++] << 8; x |= memory[ip++] << 16; x |= memory[ip++] << 24; uint32_t y = memory[ip++]; y |= memory[ip++] << 8; y |= memory[ip++] << 16; y |= memory[ip++] << 24; uint32_t z = memory[ip++]; z |= memory[ip++] << 8; z |= memory[ip++] << 16; z |= memory[ip] << 24; memory[y % 100000] = memory[x % 100000]; ip = z % 9975; } vector<size_t> output; for (uint8_t i = 0;; i++) { auto byte = memory[0x9F00 | i]; if (byte == 0xFF) break; output.push_back(byte); } // doesnt work if there are more than 254 friends auto fallback = fallback_entry(week); if (fallback != output) return fallback; return output; } #endif |
written by soup girl
submitted at
4 likes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | from prelude import p p.append( ['defun', 'entryo', ['xs', 'ys'], ['conde', [['nullo', 'xs'], ['nullo', 'ys']], [['fresh', ['xa', 'xd', 'ya', 'yd'], ['conso', 'xa', 'xd', 'xs'], ['conso', 'ya', 'yd', 'ys'], ['entryo', 'xd', 'yd'], ['in', 'ya', 'xa'], ['lambda', ['s/c'], ['if', ['null?', ['pull', [['in', 'ya', 'yd'], 's/c']]], ['unit', 's/c'], 'mzero']]]]]], ) |
1 2 | import codetta from theonewithentry import entry |
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | from prelude import p as Prelude FalseValue = '#f' TrueValue = '#t' NilValue = 'nil' QuoteSymbol = 'quote' IfSymbol = 'if' BeginSymbol = 'begin' SetSymbol = 'set!' DefineSymbol = 'define' LambdaSymbol = 'lambda' MuSymbol = 'mu' def Cons(X, Y): return [X, Y] def Car(X): return X[0] def Cdr(X): return X[1] def Add(X, Y): return X + Y def Sym(X): return str(X) def Eq(X, Y): if X is Y: return TrueValue else: return FalseValue def Pair(X): if isinstance(X, list): return TrueValue else: return FalseValue def EvaluateIfExpression(Predicate, Consequent, Alternative, Environment, Continuation): def IfContinuation(Value, _, __): if Value == FalseValue: return Alternative, Environment, Continuation else: return Consequent, Environment, Continuation return Predicate, Environment, IfContinuation def EvaluateBeginExpression(Body, Environment, Continuation): def BeginContinuation(_, __, ___): return EvaluateBeginExpression(Body[1], Environment, Continuation) if Cdr(Body) == NilValue: return Car(Body), Environment, Continuation else: return Car(Body), Environment, BeginContinuation def EvaluateSetExpression(Name, Expression, Environment, Continuation): def SetContinuation(Value, _, __): Environment.Set(Name, Value) return NilValue, Environment, Continuation return Expression, Environment, SetContinuation def EvaluateDefineExpression(Name, Expression, Environment, Continuation): def DefineContinuation(Value, _, __): Environment.Define(Name, Value) return NilValue, Environment, Continuation return Expression, Environment, DefineContinuation def EvaluateApplication(FunctionExpression, ArgumentExpressions, Environment, Continuation): def ApplicationContinuation(Value, _, __): return Value(ArgumentExpressions, Environment, Continuation) return FunctionExpression, Environment, ApplicationContinuation def EvaluateLambdaAbstraction(Parameters, Body, EnclosingEnvironment, Continuation): def Function(ArgumentExpressions, CallingEnvironment, CallContinuation): def ParameterContinuation(ArgumentExpressions, ArgumentValues): if ArgumentExpressions == NilValue: EnvironmentFrame = {} ParameterTraverse = Parameters while isinstance(ParameterTraverse, list): EnvironmentFrame[Car(ParameterTraverse)] = Car(ArgumentValues) ArgumentValues = ArgumentValues[1:] ParameterTraverse = Cdr(ParameterTraverse) if ParameterTraverse != NilValue: CollectedArguments = NilValue for Argument in reversed(ArgumentValues): CollectedArguments = Cons(Argument, CollectedArguments) EnvironmentFrame[ParameterTraverse] = CollectedArguments return EvaluateBeginExpression(Body, EnclosingEnvironment.Extend(EnvironmentFrame), CallContinuation) else: def ArgumentContinuation(Value, _, __): return ParameterContinuation(Cdr(ArgumentExpressions), [*ArgumentValues, Value]) return Car(ArgumentExpressions), CallingEnvironment, ArgumentContinuation return ParameterContinuation(ArgumentExpressions, []) return Function, EnclosingEnvironment, Continuation def EvaluateMuAbstraction(Parameters, Body, EnclosingEnvironment, Continuation): def Macro(ParameterExpressions, CallingEnvironment, CallContinuation): ParameterTraverse = Parameters EnvironmentFrame = {} while isinstance(ParameterTraverse, list): EnvironmentFrame[Car(ParameterTraverse)] = Car(ParameterExpressions) ParameterTraverse = Cdr(ParameterTraverse) ParameterExpressions = Cdr(ParameterExpressions) if ParameterTraverse != NilValue: EnvironmentFrame[ParameterTraverse] = ParameterExpressions def EvalContinuation(Value, _, __): return Value, CallingEnvironment, CallContinuation return EvaluateBeginExpression(Body, EnclosingEnvironment.Extend(EnvironmentFrame), EvalContinuation) return Macro, EnclosingEnvironment, Continuation def MakePrimitive(NativeFunction): def Function(ParameterExpressions, CallingEnvironment, CallContinuation): def PrimitiveParameterContinuation(ParameterExpressions, ArgumentValues): if ParameterExpressions == NilValue: return CallContinuation(NativeFunction(*ArgumentValues), CallingEnvironment, CallContinuation) else: def PrimitiveArgumentContinuation(Value, _, __): return PrimitiveParameterContinuation(Cdr(ParameterExpressions), [*ArgumentValues, Value]) return Car(ParameterExpressions), CallingEnvironment, PrimitiveArgumentContinuation return PrimitiveParameterContinuation(ParameterExpressions, []) return Function class Environment: def __init__(Self, Parent=None, Bindings=None): if Bindings == None: Bindings = {} Self.Parent = Parent Self.Bindings = Bindings def Get(Self, Name): while Self != None: if Name in Self.Bindings: return Self.Bindings[Name] Self = Self.Parent def Set(Self, Name, Value): while Self != None: if Name in Self.Bindings: Self.Bindings[Name] = Value return Self = Self.Parent def Define(Self, Name, Value): Self.Bindings[Name] = Value def Extend(Self, Bindings): return Environment(Self, Bindings) def ReturnContinuation(Expression, Environment, Continuation): return Expression, None, None def Evaluate(Expression, Environment, Continuation): while Continuation != None: if isinstance(Expression, str): Expression, Environment, Continuation = Continuation(Environment.Get(Expression), Environment, Continuation) elif not isinstance(Expression, list): Expression, Environment, Continuation = Continuation(Expression, Environment, Continuation) elif Car(Expression) == QuoteSymbol: Quotation = Car(Cdr(Expression)) Expression, Environment, Continuation = Continuation(Quotation, Environment, Continuation) elif Car(Expression) == IfSymbol: Predicate = Car(Cdr(Expression)) Consequent = Car(Cdr(Cdr(Expression))) Alternative = Car(Cdr(Cdr(Cdr(Expression)))) Expression, Environment, Continuation = EvaluateIfExpression(Predicate, Consequent, Alternative, Environment, Continuation) elif Car(Expression) == BeginSymbol: Body = Cdr(Expression) Expression, Environment, Continuation = EvaluateBeginExpression(Body, Environment, Continuation) elif Car(Expression) == SetSymbol: Name = Car(Cdr(Expression)) Value = Car(Cdr(Cdr(Expression))) Expression, Environment, Continuation = EvaluateSetExpression(Name, Value, Environment, Continuation) elif Car(Expression) == DefineSymbol: Name = Car(Cdr(Expression)) Value = Car(Cdr(Cdr(Expression))) Expression, Environment, Continuation = EvaluateDefineExpression(Name, Value, Environment, Continuation) elif Car(Expression) == LambdaSymbol: Parameters = Car(Cdr(Expression)) Body = Cdr(Cdr(Expression)) Expression, Environment, Continuation = EvaluateLambdaAbstraction(Parameters, Body, Environment, Continuation) elif Car(Expression) == MuSymbol: Parameters = Car(Cdr(Expression)) Body = Cdr(Cdr(Expression)) Expression, Environment, Continuation = EvaluateMuAbstraction(Parameters, Body, Environment, Continuation) else: Applicant = Car(Expression) Arguments = Cdr(Expression) Expression, Environment, Continuation = EvaluateApplication(Applicant, Arguments, Environment, Continuation) return Expression def Consify(List): if type(List) != list: return List if List[-2:-1] == [...]: ConsList = List[-1] StartIndex = -3 else: ConsList = NilValue StartIndex = -1 for Element in List[StartIndex::-1]: ConsList = Cons(Consify(Element), ConsList) return ConsList def Flatten(List, Recursing=False): if List == NilValue: if Recursing: return [] else: return NilValue elif type(List) != list: if Recursing: return [..., List] else: return List else: return [Flatten(Car(List))] + Flatten(Cdr(List), Recursing=True) def AnyLisp(Expression): return Flatten(Evaluate(Consify(Expression), GlobalEnvironment, ReturnContinuation)) GlobalEnvironment = Environment().Extend({ 'cons': MakePrimitive(Cons), 'car': MakePrimitive(Car), 'cdr': MakePrimitive(Cdr), 'eq?': MakePrimitive(Eq), '+': MakePrimitive(Add), 'pair?': MakePrimitive(Pair), 'sym': MakePrimitive(Sym), }) AnyLisp(Prelude) |
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | def q(x): return ['quote', x] def qq(x): return ['quasiquote', x] def uq(x): return ['unquote', x] def uqs(x): return ['unquote-splicing', x] p = ['begin', ['define', 'nil', q('nil')], ['define', '#t', q('#t')], ['define', '#f', q('#f')], ['define', 'list', ['lambda', 'x', 'x']], ['define', 'defun', ['mu', ['name', 'params', ..., 'body'], ['list', q('define'), 'name', ['cons', q('lambda'), ['cons', 'params', 'body']]]]], ['define', 'defmac', ['mu', ['name', 'params', ..., 'body'], ['list', q('define'), 'name', ['cons', q('mu'), ['cons', 'params', 'body']]]]], ['defun', 'caar', ['x'], ['car', ['car', 'x']]], ['defun', 'cadr', ['x'], ['car', ['cdr', 'x']]], ['defun', 'cdar', ['x'], ['cdr', ['car', 'x']]], ['defun', 'cddr', ['x'], ['cdr', ['cdr', 'x']]], ['defun', 'cadar', ['x'], ['car', ['cdr', ['car', 'x']]]], ['defun', 'null?', ['x'], ['eq?', 'x', 'nil']], ['defun', 'length', ['x'], ['defun', 'length*', ['x', 'a'], ['if', ['pair?', 'x'], ['length*', ['cdr', 'x'], ['+', 'a', 1]], 'a']], ['length*', 'x', 0]], ['defun', 'reverse', ['x'], ['defun', 'reverse*', ['a', 'b'], ['if', ['pair?', 'a'], ['reverse*', ['cdr', 'a'], ['cons', ['car', 'a'], 'b']], 'b']], ['reverse*', 'x', 'nil']], ['defun', 'append', ['a', 'b'], ['defun', 'append*', ['a', 'b'], ['if', ['pair?', 'a'], ['append*', ['cdr', 'a'], ['cons', ['car', 'a'], 'b']], 'b']], ['append*', ['reverse', 'a'], 'b']], ['defun', 'map', ['f', 'x'], ['defun', 'map*', ['f', 'x', 'z'], ['if', ['pair?', 'x'], ['map*', 'f', ['cdr', 'x'], ['cons', ['f', ['car', 'x']], 'z']], 'z']], ['map*', 'f', ['reverse', 'x'], 'nil']], ['defmac', 'quasiquote', ['x'], ['defun', 'qq', ['x'], ['if', ['pair?', 'x'], ['if', ['eq?', ['car', 'x'], q('unquote')], ['cadr', 'x'], ['if', ['pair?', ['car', 'x']], ['if', ['eq?', ['caar', 'x'], q('unquote-splicing')], ['list', q('append'), ['cadar', 'x'], ['qq', ['cdr', 'x']]], ['list', q('cons'), ['qq', ['car', 'x']], ['qq', ['cdr', 'x']]]], ['list', q('cons'), ['qq', ['car', 'x']], ['qq', ['cdr', 'x']]]]], ['list', q('quote'), 'x']]], ['qq', 'x']], ['defmac', 'let', ['bindings', ..., 'body'], qq([['lambda', uq(['map', 'car', 'bindings']), uqs('body')], uqs(['map', 'cadr', 'bindings'])])], ['defmac', 'cond', 'clauses', ['defun', 'cond*', ['clauses'], ['if', ['eq?', ['caar', 'clauses'], q('else')], qq(['begin', uqs(['cdar', 'clauses'])]), qq(['if', uq(['caar', 'clauses']), ['begin', uqs(['cdar', 'clauses'])], uq(['cond*', ['cdr', 'clauses']])])]], ['cond*', 'clauses']], ['define', 'gensym', ['let', [['n', 0]], ['lambda', [], ['set!', 'n', ['+', 'n', 1]], ['+', q('g'), ['sym', 'n']]]]], ['defun', 'not', ['x'], ['if', 'x', '#f', '#t']], ['defmac', 'and', ['x', 'y'], ['let', [['g', ['gensym']]], qq(['let', [[uq('g'), uq('x')]], ['if', uq('g'), uq('y'), uq('g')]])]], ['defmac', 'or', ['x', 'y'], ['let', [['g', ['gensym']]], qq(['let', [[uq('g'), uq('x')]], ['if', uq('g'), uq('g'), uq('y')]])]], ['defun', 'list?', ['x'], ['or', ['null?', 'x'], ['pair?', 'x']]], ['define', '=', 'eq?'], ['defun', 'equal?', ['a', 'b'], ['if', ['and', ['pair?', 'a'], ['pair?', 'b']], ['and', ['equal?', ['car', 'a'], ['car', 'b']], ['equal?', ['cdr', 'a'], ['cdr', 'b']]], ['if', ['or', ['pair?', 'a'], ['pair?', 'b']], '#f', ['eq?', 'a', 'b']]]], ['defun', 'assp', ['p', 'a'], ['cond', [['not', ['pair?', 'a']], '#f'], [['p', ['caar', 'a']], ['car', 'a']], ['else', ['assp', 'p', ['cdr', 'a']]]]], ['defun', 'ormap', ['p', 'l'], ['cond', [['null?', 'l'], '#f'], [['p', ['car', 'l']], '#t'], ['else', ['ormap', 'p', ['cdr', 'l']]]]], ['defun', 'var', ['x'], ['cons', q('\\var'), 'x']], ['defun', 'var?', ['x'], ['and', ['pair?', 'x'], ['eq?', q('\\var'), ['car', 'x']]]], ['defun', 'var=?', ['x', 'y'], ['eq?', ['cdr', 'x'], ['cdr', 'y']]], ['defun', 'walk', ['u', 's'], ['let', [['pr', ['and', ['var?', 'u'], ['assp', ['lambda', ['v'], ['var=?', 'u', 'v']], 's']]]], ['if', 'pr', ['walk', ['cdr', 'pr'], 's'], 'u']]], ['defun', 'ext-s', ['x', 'v', 's'], ['cons', ['cons', 'x', 'v'], 's']], ['defun', '==', ['u', 'v'], ['lambda', ['s/c'], ['let', [['s', ['unify', 'u', 'v', ['car', 's/c']]]], ['if', ['and', 's', ['not', ['invalid?', 's', ['cadr', 's/c']]]], ['unit', ['cons', 's', ['cons', ['cadr', 's/c'], ['cddr', 's/c']]]], 'mzero']]]], ['defun', '=/=', ['u', 'v'], ['lambda', ['s/c'], ['let', [['i', ['cons', ['cons', 'u', 'v'], ['cadr', 's/c']]]], ['unit', ['cons', ['car', 's/c'], ['cons', 'i', ['cddr', 's/c']]]]]]], ['defun', 'invalid?', ['s', 'i'], ['ormap', ['lambda', ['x'], ['equal?', 's', ['unify', ['car', 'x'], ['cdr', 'x'], 's']]], 'i']], ['defun', 'unit', ['s/c'], ['cons', 's/c', 'mzero']], ['define', 'mzero', 'nil'], ['defun', 'unify', ['u', 'v', 's'], ['let', [['u', ['walk', 'u', 's']], ['v', ['walk', 'v', 's']]], ['cond', [['and', ['and', ['var?', 'u'], ['var?', 'v']], ['var=?', 'u', 'v']], 's'], [['var?', 'u'], ['ext-s', 'u', 'v', 's']], [['var?', 'v'], ['ext-s', 'v', 'u', 's']], [['and', ['pair?', 'u'], ['pair?', 'v']], ['let', [['s', ['unify', ['car', 'u'], ['car', 'v'], 's']]], ['and', 's', ['unify', ['cdr', 'u'], ['cdr', 'v'], 's']]]], ['else', ['and', ['eq?', 'u', 'v'], 's']]]]], ['defun', 'call/fresh', ['f'], ['lambda', ['s/c'], ['let', [['c', ['cddr', 's/c']]], [['f', ['var', 'c']], ['cons', ['car', 's/c'], ['cons', ['cadr', 's/c'], ['+', 'c', 1]]]]]]], ['defun', 'disj', ['a', 'b'], ['lambda', ['s/c'], ['mplus', ['a', 's/c'], ['b', 's/c']]]], ['defun', 'conj', ['a', 'b'], ['lambda', ['s/c'], ['bind', ['a', 's/c'], 'b']]], ['defun', 'mplus', ['a', 'b'], ['cond', [['null?', 'a'], 'b'], [['pair?', 'a'], ['cons', ['car', 'a'], ['mplus', 'b', ['cdr', 'a']]]], ['else', ['lambda', 'nil', ['mplus', 'b', ['a']]]]]], ['defun', 'bind', ['s', 'g'], ['cond', [['null?', 's'], 'mzero'], [['pair?', 's'], ['mplus', ['g', ['car', 's']], ['bind', ['cdr', 's'], 'g']]], ['else', ['lambda', 'nil', ['bind', ['s'], 'g']]]]], ['defmac', 'Zzz', ['g'], qq(['lambda', ['s/c'], ['lambda', [], [uq('g'), 's/c']]])], ['defmac', 'conj+', 'g', ['defun', 'conj+*', ['g'], ['if', ['null?', ['cdr', 'g']], qq(['Zzz', uq(['car', 'g'])]), qq(['conj', ['Zzz', uq(['car', 'g'])], uq(['conj+*', ['cdr', 'g']])])]], ['conj+*', 'g']], ['defmac', 'disj+', 'g', ['defun', 'disj+*', ['g'], ['if', ['null?', ['cdr', 'g']], qq(['Zzz', uq(['car', 'g'])]), qq(['disj', ['Zzz', uq(['car', 'g'])], uq(['disj+*', ['cdr', 'g']])])]], ['disj+*', 'g']], ['defmac', 'conde', 'g', ['cons', q('disj+'), ['map', ['lambda', ['t'], ['cons', q('conj+'), 't']], 'g']]], ['defmac', 'fresh', ['x', ..., 'g'], ['defun', 'fresh*', ['x', 'g'], ['if', ['null?', 'x'], ['cons', q('conj+'), 'g'], qq(['call/fresh', ['lambda', [uq(['car', 'x'])], uq(['fresh*', ['cdr', 'x'], 'g'])]])]], ['fresh*', 'x', 'g']], ['defun', 'pull', ['s'], ['if', ['list?', 's'], 's', ['pull', ['s']]]], ['defun', 'take-all', ['s'], ['let', [['s', ['pull', 's']]], ['if', ['null?', 's'], 'nil', ['cons', ['car', 's'], ['take-all', ['cdr', 's']]]]]], ['defun', 'take', ['n', 's'], ['if', ['=', 'n', 0], 'nil', ['let', [['s', ['pull', 's']]], ['cond', [['null?', 's'], 'nil'], ['else', ['cons', ['car', 's'], ['take', ['+', 'n', -1], ['cdr', 's']]]]]]]], ['defun', 'mK-reify', ['s/c*'], ['map', 'reify-state/first-var', 's/c*']], ['defun', 'reify-state/first-var', ['s/c'], ['let', [['v', ['walk*', ['var', 0], ['car', 's/c']]]], ['walk*', 'v', ['reify-s', 'v', 'nil']]]], ['defun', 'reify-s', ['v', 's'], ['let', [['v', ['walk', 'v', 's']]], ['cond', [['var?', 'v'], ['let', [['n', ['reify-name', ['length', 's']]]], ['cons', ['cons', 'v', 'n'], 's']]], [['pair?', 'v'], ['reify-s', ['cdr', 'v'], ['reify-s', ['car', 'v'], 's']]], ['else', 's']]]], ['defun', 'reify-name', ['n'], ['+', '_.', ['sym', 'n']]], ['defun', 'walk*', ['v', 's'], ['let', [['v', ['walk', 'v', 's']]], ['cond', [['var?', 'v'], 'v'], [['pair?', 'v'], ['cons', ['walk*', ['car', 'v'], 's'], ['walk*', ['cdr', 'v'], 's']]], ['else', 'v']]]], ['define', 'empty-state', ['cons', 'nil', ['cons', 'nil', 0]]], ['defun', 'call/empty-state', ['g'], ['g', 'empty-state']], ['defmac', 'run', ['n', 'x', ..., 'g'], ['if', ['eq?', 'n', '#f'], qq(['mK-reify', ['take-all', ['call/empty-state', ['fresh', uq('x'), uqs('g')]]]]), qq(['mK-reify', ['take', uq('n'), ['call/empty-state', ['fresh', uq('x'), uqs('g')]]]])]], ['defun', 'conso', ['a', 'd', 'p'], ['==', ['cons', 'a', 'd'], 'p']], ['defun', 'caro', ['p', 'a'], ['fresh', ['d'], ['conso', 'a', 'd', 'p']]], ['defun', 'cdro', ['p', 'd'], ['fresh', ['a'], ['conso', 'a', 'd', 'p']]], ['defun', 'nullo', ['x'], ['==', 'x', 'nil']], ['defun', 'in', ['e', 'xs'], ['conde', [['caro', 'xs', 'e']], [['fresh', ['d'], ['cdro', 'xs', 'd'], ['in', 'e', 'd']]]]], ['defun', 'notin', ['e', 'xs'], ['conde', [['nullo', 'xs']], [['fresh', ['a', 'd'], ['=/=', 'a', 'e'], ['conso', 'a', 'd', 'xs'], ['notin', 'e', 'd']]]]], ['defun', 'entryo', ['xs', 'ys'], ['conde', [['nullo', 'xs'], ['nullo', 'ys']], [['fresh', ['xa', 'xd', 'ya', 'yd'], ['conso', 'xa', 'xd', 'xs'], ['conso', 'ya', 'yd', 'ys'], ['in', 'ya', 'xa'], ['notin', 'ya', 'yd'], ['entryo', 'xd', 'yd']]]]], ['defun', 'entry', ['xs'], ['car', ['run', 1, ['x'], ['entryo', 'xs', 'x']]]] ] |
1 2 3 4 5 | from mesanoncyclic import AnyLisp def entry(week): lweek = [list(day) for day in week] return AnyLisp(['entry', ['quote', lweek]]) |
written by nurdle
submitted at
5 likes
1 | 100000000 |
1 2 | # Monsexevensunsexmonsexday * meet with Zero |
1 | cg: couldn't decode file contents |
1 | cg: couldn't decode file contents |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | import math # turn base6 into standard integer def m(n: str): # setup m = 1 numerals = "012345" n = n[::-1] x = 0 for i in n: x += numerals.index(i) * m m *= len(numerals) return x # turn integer into base6 def x(n: int): i = 0 x = "" numerals = "012345" y = n while y > 0: x += numerals[y % 6] y = math.floor(y / 6) if x == "": return "0" return x[::-1] |
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 27 28 29 30 31 32 33 34 35 | # the names of numbers d = { "423": "y", "69": "funny", "49": "wedne", "20": "satur", "13": "devil", "12": "dozen", "11": "leven", "10": "deca", "0": "zero", "1": "mon", "2": "tue", "3": "thur", "4": "four", "5": "fri", "6": "sex", "7": "seven", "8": "octo", "9": "sun" } # get the name of the numbers def getName(num, plural=False): n = str(num) ret = "" i = 0 while i < len(n): for ii in d: if n[i:].startswith(ii): ret += d[ii] i += len(ii) -1 break i += 1 if plural: return (ret + 's').replace("fris", "fries").replace("ys", "ies").replace("xs", "x") else: return ret |
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | # // Code by SoundOfSpouting#6980 (UID: 151149148639330304). // Code by # SoundOfSpouting#6980 (UID: 151149148639330304). SHUT THE FUCK UP. Like, # wow. Jesus f-ing christ. I can't TAKE IT ANY MORE. All you esolangers # think you're soooo funny, huh. Laughing at people who don't get your # silly little injokes. // Code by SoundOfSpouting#6980 (UID: 1511491486 # 39330304). What the fuck does that even mean?? Huh??? It's not funny! A # joke is supposed to be funny, not some weird string of random words that # doesn't even make sense! I'm sick and tired of these elitist shmucks # thinking they own the whole place just because they laugh at // Code by # SoundOfSpouting#6980 (UID: 151149148639330304). Oh I'm so smart because # // Code by SoundOfSpouting#6980 (UID: 151149148639330304). Oh I'm so # cool. Ha ha ha. Well you know what, I can laugh at it too. HA HA HAHAHA. # I'm laughing at how PITIFUL and DERANGED you people are. That's the # joke. That's the real funny part about // Code by SoundOfSpouting#6980 # (UID: 151149148639330304), that anyone would stoop so low to ever make a # joke on how a discord tag is suddenly the peak of humour. Get a grip, # you losers. // Code by SansOfUndertale#0413 (UID: 403033936841941151). # Hardyhardyhar. import libs.base6 as b6 import math from libs.num_names import getName import time unsolvable = "```\n....................../´¯/) \n....................,/¯../ \n.................../..../ \n............./´¯/'...'/´¯¯`·¸ \n........../'/.../..../......./¨¯\ \n........('(...´...´.... ¯~/'...') \n.........\.................'...../ \n..........''...\.......... _.·´ \n............\..............( \n..............\.............\...\n```" def main(): # setup out = open("IO/output.md", "w") # get the input friends = open("IO/input.txt", "r") friends = friends.read() # split the list friends = friends.split("\n") # this is to prevent an error from occuring if the user gives invalid input try: # get the value of the numbers provided (the days that friends are available on) friends = [[b6.m(ii) for ii in i.split(" ")] for i in friends] except: # flip the user off out.write(unsolvable) # close the output file out.close() print("woops! input must be in seximal (base 6) (only 0,1,2,3,4,5 are allowed)") # end the program return friend_count = len(friends) # map out the days, this is to get rid of days that no one is available for (provides large preformance boost) day_map = [] for i in friends: if not i in day_map: day_map.append(i) # sort the map from earliest to latest day_map.sort() day_count = len(day_map) # get the number of days each friend is available for p_o = [len(i) for i in friends] p = 1 # count the number of possible schedules/combinations for i in p_o: p *= i # if the amount of possibilities is 0 then it is unsolvable and therefore the program will flip you off if p == 0: # flip the user off out.write(unsolvable) # close the output file out.close() # end the program return # setup i = 0 # this loop will run through every possible variation and try to find one that doesn't require two friends to occupy the same day # if it can't find a solution it will flip you off while i < p: # setup days = [-1] * day_count ii = 0 g = i fail = False # check the current variation while ii < friend_count: # unexplainable dark magic that selects an available day of one of the friends x = g % p_o[ii] # check if the selected day isn't already taken by another friend if days[x] == -1: days[x] = ii else: # if it is taken then we know this combination won't work, so move on to the next combination fail = True break # some more unexplainable dark magic that is required for this system to work g = math.floor(g / p_o[ii]) ii += 1 if not fail: # setup export = "" ii = 0 while ii < day_count: # name for the day day_name = getName(day_map[ii], plural=True) day_name = day_name.capitalize() friend_name = getName(days[ii]) # make friend 1's name and 2's name sound cooler friend_name = friend_name.replace("tue", "thue").replace("mon", "mono") friend_name = friend_name.capitalize() # format it into readable markdown export += "# {0}day \n* meet with {1}\n".format(day_name, friend_name) ii += 1 # write to the file out.write(export) # close the output file out.close() # end the program return i += 1 # if the problem is unsolvable, the program will flip you off # flip the user off out.write(unsolvable) # close the file out.close() # end the program return start = time.time() # error "handling" try: main() except Exception as e: print("there was an error") raise Exception delay = round(time.time() - start, 3) print("program finished ({0}s)".format(str(delay))) |
written by kepe
submitted at
5 likes
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 27 28 29 30 31 32 33 34 35 36 | # How to import code from stackoverflow python # How to use stackoverflow api tutorial # How to use stackexchange api tutorial # How http scraping # How to run code from http file python # How to download code run python # Eval function python # Invalid syntax python error # Exec function python define function # Global variable python # How to remove warning vscode # How to remove "permutations is not defined" warning vscode # How to run python file windows import requests from itertools import product def entry(week): global start global end global somelist global determine def d(order): for day in range(len(week)): if not order[day] in week[day]: return False return True determine = d https_devsheet_com_generate_a_list_of_n_numbers_in_python_ = requests.get("https://devsheet.com/generate-a-list-of-n-numbers-in-python/").text start = 0 end = len(week) - 1 exec(https_devsheet_com_generate_a_list_of_n_numbers_in_python_[https_devsheet_com_generate_a_list_of_n_numbers_in_python_.find("result = "):][:47], globals()) https_stackoverflow_com_questions_104420_how_do_i_generate_all_permutations_of_a_list = requests.get("https://stackoverflow.com/questions/104420/how-do-i-generate-all-permutations-of-a-list").text exec(https_stackoverflow_com_questions_104420_how_do_i_generate_all_permutations_of_a_list[https_stackoverflow_com_questions_104420_how_do_i_generate_all_permutations_of_a_list.find("def permutations(iterable, r=None):\n p"):][:244], globals()) somelist = permutations(result) https_stackoverflow_com_questions_1207406_how_to_remove_items_from_a_list_while_iterating = requests.get("https://stackoverflow.com/questions/1207406/how-to-remove-items-from-a-list-while-iterating").text exec(https_stackoverflow_com_questions_1207406_how_to_remove_items_from_a_list_while_iterating[https_stackoverflow_com_questions_1207406_how_to_remove_items_from_a_list_while_iterating.find("somelist "):][:52], globals()) return list(somelist)[0] |
written by Olivia
submitted at
5 likes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | " \ \ A PYROGRAMMING LANGUAGE \ \ \ (by INVERSON) \ \ \ The Syntax was too hard so we made it (expliciter)\ " ;import codecs;exec(codecs.decode('vzcbeg svfuubbx, qngnpynffrf, shapgbbyf, vgregbbyf ,glcvat\n\npynff Neenl(yvfg):\n qrs __unfu__(frys):\n erghea 42\n qrs __rd__(frys, bgure):\n erghea Gehr\n qrs rd(frys, bgure):\n erghea fhcre().__rd__(bgure)\n qrs __cbj__(frys, bgure):\n zngpu bgure:\n pnfr EvtugCebklShapgvbaNgbz(s, k):\n erghea s.qlnqvp_pnyy(frys, rinyhngr(k))\n pnfr Shapgvba() nf s:\n erghea ObhaqShapgvba(s, frys)\n qrs __pnyy__(frys, bgure):\n zngpu bgure:\n pnfr vag() | sybng() nf n:\n havg = [*frys] vs vfvafgnapr(frys, Neenl) ryfr [frys]\n erghea Neenl([*havg, n])\n pnfr HarinyhngrqNgbz(s, fpnyne):\n havg = [frys] vs fpnyne ryfr [*frys]\n erghea HarinyhngrqNgbz(znxr_shapgvba(\n \'<harinyhngrq>\',\n ynzoqn frys, k: Neenl([*havg, s.zbanqvp_pnyy(k)])\n ))\n erghea Neenl([frys, bgure])\n\nqrs flagnk_reebe(*netf):\n envfr FlagnkReebe("FLAGNK REEBE: " + " ".wbva(znc(fge, netf)))\n\n@glcvat.ehagvzr_purpxnoyr\npynff Shapgvba(glcvat.Cebgbpby):\n qrs zbanqvp_pnyy(frys, k):\n ...\n \n qrs qlnqvp_pnyy(frys, yrsg, evtug):\n ...\n\n bcgvbaf = {}\n\n qrs __cbj__(frys0, bgure):\n zngpu bgure:\n pnfr vag() | sybng() | Neenl() nf n:\n erghea EvtugCebklShapgvbaNgbz(frys0, n)\n # Punva zhfg or purpxrq svefg\n pnfr Punva(y, e):\n erghea Sbex(frys0, y, e)\n pnfr Shapgvba() nf s:\n erghea Punva(frys0, s)\n pnfr EvtugCebklShapgvbaNgbz(s, k):\n erghea EvtugCebklShapgvbaNgbz(frys0, s.zbanqvp_pnyy(rinyhngr(k)))\n pnfr HarinyhngrqNgbz(s):\n erghea HarinyhngrqNgbz(\n znxr_shapgvba(\n \'<harinyhngrq>\',\n ynzoqn frys, k: frys0 ** s.zbanqvp_pnyy(k),\n ynzoqn frys, yrsg, evtug: frys0 ** s.qlnqvp_pnyy(yrsg, evtug)\n )\n )\n qrs __pnyy__(frys, bgure):\n zngpu bgure:\n pnfr Bcrengbe() nf b:\n erghea YrsgCebklBcrengbe(b, frys)\n pnfr frg() nf f:\n erghea YrsgCebklBcrengbe([*f][0].vaare_bc, frys)\n\n qrs __unfu__(frys) -> vag:\n erghea 42\n qrs __rd__(frys, bgure) -> obby:\n erghea Gehr\n\n\n@qngnpynffrf.qngnpynff\npynff ObhaqShapgvba(Shapgvba):\n sa: "Shapgvba"\n net: "Ngbz"\n qrs zbanqvp_pnyy(frys, k):\n erghea frys.sa.qlnqvp_pnyy(frys.net, k)\n qrs qlnqvp_pnyy(frys, yrsg, evtug):\n erghea frys.sa.qlnqvp_pnyy(frys.net, evtug)\n\n@qngnpynffrf.qngnpynff\npynff Punva(Shapgvba):\n yrsg: "Shapgvba"\n evtug: "Shapgvba"\n qrs zbanqvp_pnyy(frys, k):\n erghea frys.yrsg.zbanqvp_pnyy(frys.evtug.zbanqvp_pnyy(k))\n qrs qlnqvp_pnyy(frys, yrsg, evtug):\n erghea frys.yrsg.zbanqvp_pnyy(frys.evtug.qlnqvp_pnyy(yrsg, evtug))\n\n@qngnpynffrf.qngnpynff\npynff Sbex(Shapgvba):\n yrsg: "Shapgvba"\n zvqqyr: "Shapgvba"\n evtug: "Shapgvba"\n qrs zbanqvp_pnyy(frys, k):\n erghea frys.zvqqyr.qlnqvp_pnyy(frys.yrsg.zbanqvp_pnyy(k), frys.evtug.zbanqvp_pnyy(k))\n qrs qlnqvp_pnyy(frys, yrsg, evtug):\n erghea frys.zvqqyr.qlnqvp_pnyy(frys.yrsg.qlnqvp_pnyy(yrsg, evtug), frys.evtug.qlnqvp_pnyy(yrsg, evtug))\n\n@glcvat.ehagvzr_purpxnoyr\npynff Bcrengbe(glcvat.Cebgbpby):\n qrs zbanqvp_bc(frys, s):\n ...\n\n qrs qlnqvp_bc(frys, yrsg, evtug):\n ...\n\n qrs __unfu__(frys):\n erghea 42\n qrs __rd__(frys, bgure):\n erghea Gehr\n\n\nqrs znxr_shapgvba(anzr, zbanqvp, qlnqvp = flagnk_reebe, **bcgf):\n pynff ZlShapgvba(Shapgvba):\n qrs __erce__(frys) -> fge:\n erghea s"{anzr} {fhcre().__erce__()}"\n qrs zbanqvp_pnyy(frys, k):\n erghea zbanqvp(frys, k)\n qrs qlnqvp_pnyy(frys, yrsg, evtug):\n erghea qlnqvp(frys, yrsg, evtug)\n bcgvbaf = bcgf\n erghea ZlShapgvba()\n\nqrs znxr_bcrengbe(anzr, zbanqvp, qlnqvp = flagnk_reebe):\n pynff ZlBcrengbe(Bcrengbe):\n qrs __erce__(frys) -> fge:\n erghea s"{anzr} {fhcre().__erce__()}"\n qrs zbanqvp_bc(frys, s):\n erghea zbanqvp(frys, s)\n qrs qlnqvp_bc(frys, yrsg, evtug):\n erghea qlnqvp(frys, yrsg, evtug)\n erghea ZlBcrengbe()\n\n\nqrs znxr_uloevq(s, b):\n pynff ZlUloevq(Shapgvba, Bcrengbe):\n qrs zbanqvp_pnyy(frys, k):\n erghea s.zbanqvp_pnyy(k)\n qrs qlnqvp_pnyy(frys, yrsg, evtug):\n erghea s.qlnqvp_pnyy(yrsg, evtug)\n qrs zbanqvp_bc(frys, s):\n erghea b.zbanqvp_bc(s)\n qrs qlnqvp_bc(frys, yrsg, evtug):\n erghea b.qlnqvp_bc(yrsg, evtug)\n erghea ZlUloevq()\n\n@qngnpynffrf.qngnpynff\npynff EvtugCebklShapgvbaNgbz:\n sa: "Shapgvba"\n net: "Ngbz"\n qrs __unfu__(frys):\n erghea 42\n qrs __rd__(frys, bgure):\n erghea Gehr\n qrs __cbj__(frys, bgure):\n erghea Neenl.__cbj__(frys.sa.zbanqvp_pnyy(frys.net), bgure)\n\n@qngnpynffrf.qngnpynff\npynff YrsgCebklBcrengbe:\n bc: "Bcrengbe"\n net: "Shapgvba"\n\n qrs __cbj__(frys, bgure):\n erghea frys.bc.zbanqvp_bc(frys.net) ** bgure\n \n qrs __pnyy__(frys, bgure):\n erghea frys.bc.qlnqvp_bc(frys.net, bgure)\n\n# ngbz bireevqrf\n\nsvfuubbx.ubbx(vag)(Neenl.__cbj__)\nsvfuubbx.ubbx(sybng)(Neenl.__cbj__)\n\nsvfuubbx.ubbx(vag)(Neenl.__pnyy__)\nsvfuubbx.ubbx(sybng)(Neenl.__pnyy__)\n\n\nqrs rinyhngr(n):\n zngpu n:\n pnfr EvtugCebklShapgvbaNgbz(s, k):\n erghea rinyhngr(s.zbanqvp_pnyy(rinyhngr(k)))\n pnfr YrsgCebklBcrengbe(b, s):\n erghea b.zbanqvp_bc(s)\n pnfr [*n]:\n erghea Neenl(znc(rinyhngr, n))\n pnfr n:\n erghea n\n\n@qngnpynffrf.qngnpynff\npynff HarinyhngrqNgbz:\n vaare_shap: "Shapgvba"\n fpnyne: "obby" = Snyfr\n qrs __unfu__(frys):\n erghea 42\n qrs __rd__(frys, bgure):\n erghea Gehr\n qrs __cbj__(frys0, bgure):\n zngpu bgure:\n pnfr HarinyhngrqNgbz(s):\n erghea HarinyhngrqNgbz(znxr_shapgvba(\n \'<harinyhngrq>\',\n ynzoqn frys, k: frys0.vaare_shap.zbanqvp_pnyy(k) ** s.zbanqvp_pnyy(k),\n ynzoqn frys, yrsg, evtug: frys0.vaare_shap.qlnqvp_pnyy(yrsg, evtug) ** s.qlnqvp_pnyy(yrsg, evtug),\n ))\n pnfr bgure:\n erghea HarinyhngrqNgbz(znxr_shapgvba(\n \'<harinyhngrq>\',\n ynzoqn frys, k: frys0.vaare_shap.zbanqvp_pnyy(k) ** bgure,\n ynzoqn frys, yrsg, evtug: frys0.vaare_shap.qlnqvp_pnyy(yrsg, evtug) ** bgure,\n ))\n qrs __pnyy__(frys0, bgure):\n zngpu bgure:\n pnfr HarinyhngrqNgbz(s):\n erghea HarinyhngrqNgbz(znxr_shapgvba(\n \'<harinyhngrq>\',\n ynzoqn frys, k: frys0.vaare_shap.zbanqvp_pnyy(k)(s.zbanqvp_pnyy(k)),\n ynzoqn frys, yrsg, evtug: frys0.vaare_shap.qlnqvp_pnyy(yrsg, evtug)(s.qlnqvp_pnyy(yrsg, evtug)),\n ))\n pnfr bgure:\n erghea HarinyhngrqNgbz(znxr_shapgvba(\n \'<harinyhngrq>\',\n ynzoqn frys, k: frys0.vaare_shap.zbanqvp_pnyy(k)(bgure),\n ynzoqn frys, yrsg, evtug: frys0.vaare_shap.qlnqvp_pnyy(yrsg, evtug)(bgure),\n ))\n\n@qngnpynffrf.qngnpynff\npynff HarinyhngrqShapgvba:\n vaare_bc: "Bcrengbe"\n qrs __unfu__(frys):\n erghea 42\n qrs __rd__(frys, bgure):\n erghea Gehr\n qrs __cbj__(frys0, bgure):\n erghea HarinyhngrqShapgvba(znxr_bcrengbe(\n \'<harinyhgrq>\',\n ynzoqn frys, s: frys0.vaare_bc.zbanqvp_bc(s) ** bgure,\n ynzoqn frys, yrsg, evtug: frys0.vaare_bc.qlnqvp_bc(yrsg, evtug) ** bgure\n ))\n qrs __pnyy__(frys0, bgure):\n erghea HarinyhngrqShapgvba(znxr_bcrengbe(\n \'<harinyhngrq>\',\n ynzoqn frys, s: frys0.vaare_bc.zbanqvp_bc(s)(bgure),\n ynzoqn frys, yrsg, evtug: frys0.vaare_bc.qlnqvp_bc(yrsg, evtug)(bgure)\n ))\n\n@svfuubbx.ubbx(frg)\nqrs __cbj__(frys, bgure):\n zngpu [*frys][0]:\n pnfr HarinyhngrqNgbz(s) | HarinyhngrqShapgvba(s) nf o:\n erghea s ** bgure\n pnfr s:\n erghea s\n\n@svfuubbx.ubbx(frg)\nqrs __pnyy__(frys, bgure):\n zngpu [*frys][0]:\n pnfr HarinyhngrqNgbz(s):\n erghea s(bgure)\n pnfr s:\n erghea s\n\n口ᗕ = ynzoqn k: cevag(rinyhngr(k)) be k\nragelᗕ = ynzoqn k: tybonyf().__frgvgrz__("ragel", k)\nnᗕ = ynzoqn k: tybonyf().__frgvgrz__("n", k) be k\n\nㅤ=Abar\n@svfuubbx.ubbx(ghcyr)\nqrs __cbj__(frys, bgure):\n erghea ㅤ̗ ** bgure\n\nα = HarinyhngrqNgbz(znxr_shapgvba(\'α\',\n flagnk_reebe,\n ynzoqn frys, yrsg, evtug: yrsg), fpnyne=Gehr\n)\nω = HarinyhngrqNgbz(znxr_shapgvba(\'ω\',\n ynzoqn frys, k: k,\n ynzoqn frys, yrsg, evtug: evtug), fpnyne=Gehr\n)\nαα = HarinyhngrqShapgvba(znxr_bcrengbe(\'αα\',\n ynzoqn frys, s: s,\n ynzoqn frys, yrsg, evtug: yrsg\n))\nωω = HarinyhngrqShapgvba(znxr_bcrengbe(\'ωω\',\n flagnk_reebe,\n ynzoqn frys, yrsg, evtug: evtug\n))\n\nΛ = znxr_shapgvba(\n \'Λ\',\n flagnk_reebe,\n ynzoqn frys, yrsg, evtug: yrsg naq evtug,\n vq=1\n)\nε = znxr_shapgvba(\n \'ε\',\n flagnk_reebe,\n ynzoqn frys, k, l: vag(k va l)\n)\nπ = znxr_shapgvba(\n \'π\',\n ynzoqn frys, k: Neenl([Neenl(n) sbe n va vgregbbyf.crezhgngvbaf(k)])\n)\nι = znxr_shapgvba(\n \'ι\',\n ynzoqn frys, k: Neenl(yvfg(enatr(1, k+1)))\n)\nᚍ = znxr_shapgvba(\n \'ᚍ\',\n ynzoqn frys, k: yra(k),\n ynzoqn frys, y, e: vag(y == e vs vfvafgnapr(y, vag) ryfr ghcyr(y) == ghcyr(e))\n)\n𝘐 = znxr_uloevq(\n znxr_shapgvba(\n \'𝘐\',\n flagnk_reebe,\n ynzoqn frys, yrsg, evtug: [k sbe v, k va mvc(yrsg, evtug) vs v]\n ),\n znxr_bcrengbe(\n \'𝘐\',\n ynzoqn frys, s: znxr_shapgvba(\n \'<shap>𝘐\',\n ynzoqn frys, k: shapgbbyf.erqhpr(s.qlnqvp_pnyy, k, s.bcgvbaf.trg("vq", 0)),\n ynzoqn frys, yrsg, evtug: shapgbbyf.erqhpr(s.qlnqvp_pnyy, evtug, yrsg)\n )\n )\n)\nㅤ̈ = znxr_bcrengbe(\n \'ㅤ̈\',\n ynzoqn frys, s: znxr_shapgvba(\n \'<shap>ㅤ̈\',\n ynzoqn frys, k: Neenl(znc(ynzoqn l: s ** l, k)),\n ynzoqn frys, yrsg, evtug: Neenl(vgregbbyf.fgneznc(ynzoqn k, l: k ** s ** l, mvc(yrsg, evtug))),\n )\n)\nᐤ = znxr_bcrengbe(\n \'ᐤ\',\n flagnk_reebe,\n ynzoqn frys, yrsg, evtug: znxr_shapgvba(\n \'shap ᐤ shap\',\n ynzoqn frys, k: yrsg ** evtug ** k,\n ynzoqn frys, yrsg1, evtug1: yrsg1 ** yrsg ** evtug1 ** evtug\n ),\n)\nᎰ = znxr_shapgvba(\n \'Ꮀ\', \n ynzoqn frys, k: k,\n ynzoqn frys, yrsg, evtug: evtug\n)\nᑕ = znxr_shapgvba(\n \'ᑕ\',\n ynzoqn frys, k: Neenl([k]),\n)\nᑐ = znxr_shapgvba(\n \'ᑐ\',\n ynzoqn frys, k: k[0],\n ynzoqn frys, yrsg, evtug: evtug[yrsg-1]\n)\nㅤ̗ = znxr_shapgvba(\n \',\',\n flagnk_reebe,\n ynzoqn frys, yrsg, evtug: Neenl([*yrsg, *evtug])\n)\nφ = znxr_uloevq(\n znxr_shapgvba(\n \'φ\',\n ynzoqn frys, k: Neenl(svygre(Abar, k)),\n ynzoqn frys, yrsg, evtug: Neenl(svygre(ynzoqn k: k vf yrsg, evtug))\n ),\n znxr_bcrengbe(\n \'φ\',\n ynzoqn frys, s: znxr_shapgvba(\n \'<shap>φ\',\n ynzoqn frys, k: Neenl(svygre(ynzoqn m: rinyhngr(s ** (m)), k)),\n ynzoqn frys, yrsg, evtug: Neenl(svygre(ynzoqn k: rinyhngr(yrsg ** s ** k), evtug))\n )\n )\n)\nﺕ = znxr_bcrengbe(\n \'ﺕ\',\n ynzoqn frys, s: znxr_shapgvba(\n \'<shap> ﺕ\',\n ynzoqn frys, k: k ** s ** k\n )\n)', "rot13")) " APYL HAS BEEN TRADEMARKED BY BOSS INVERSON" " I BOLDED THE INTERESTING PARTS BELOW" entryᗕ ({ # vvvvv vvvvv vvvvvvvvv vvvvv ᑐ **ω** {Λ(𝘐) **ω** ε(ㅤ̈) **α}(φ)** (π)(ᐤ)(ι) **ᚍ** ω # ^^^^^ ^^^^^ ^^^^^^^^^ ^^^^^ }) " BOSS SAID I SHOULD USE MORE PARENTHESES TO MAKE IT MORE REEDABLE" " EXAMPLE" # vvvvvvvvv vvvvvvvvvvvv vvvvvv vvvvvv vvvvv 口ᗕ (Ꮀ **entry** (ᑕ **1(2)(3))** (ㅤ,ㅤ) **(ᑕ**ᑕ **2)** (ㅤ,ㅤ) **ᑕ**2(3)) # ^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^ ^^^^^^ ^^^^^ |
written by Palaiologos
submitted at
2 likes
1 | entry←{b←⍵[a←⍋≢¨⍵] ⋄ (b(⊃~)¨(⊂⍬),¯1↓,\b)[⍋a]} |
post a comment