name | correct guesses | games together | ratio |
---|---|---|---|
Olivia | 1 | 4 | 0.250 |
LyricLy | 0 | 4 | 0.000 |
razetime | 0 | 4 | 0.000 |
name | correct guesses | games together | ratio |
---|---|---|---|
razetime | 2 | 4 | 0.500 |
LyricLy | 1 | 4 | 0.250 |
Olivia | 1 | 4 | 0.250 |
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 | # Code by LyricLy from PIL import Image from math import sin,cos,radians as rad,\ copysign as s i = Image.new(mode='L',size=(512,512)) s = 0 #code by code by code def tf(s,point): return (int(s*point[0]+256),int(\ s*point[1]+256)) def spiro(R,r,d): assert R>r s = 250/max(R,R-r,R-r+d) for a in range(3600): α=a*r/10 # Code by RocketRace p=(cos(rad(α))*R,sin(rad(α))*R) i.putpixel(tf(s, p),120) c=(p[0]-cos(rad(α))*r,p[1]-\ sin(rad(α))*r) i.putpixel(tf(s,c),80) δ=rad(α)+-1*rad(α)*R/r path=(cos(δ)*d+c[0],sin(δ)*d+c[1]) i.putpixel(tf(s,path),255) i.save("spiro.png") spiro(5,3,5) # coded by palaiologos |
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 | function entry(Source, Input){ InputStack = Input // This is the "left stack", also known as the "stack not on the Right". Input goes here. kcatStupnI = []; // This is the "right stack", also known as the "stack on the Right". The evil twin of the input stack. Active = 1.0; // Left stack Active: 1 is at the Left of the decimal point. FormattedSource = Source.replace(/(\[\]|\(\)|{\}|\<>)/g, nilad => ({"()":"○","[]":"⎕","{}":"⍬","<>":"♢"}[nilad])); // APL symbols look good and Brain-Flak was simpler to implement this way to me. console.log(FormattedSource); // Bask in the glory of APL symbols. function run(Snippet) { let Pointer = 0 let EValue = []; // Short for "evaluated value". while (Pointer * Pointer != Math.pow(Snippet.length,2)) { // Are we done with the snippet? switch (Snippet[Pointer]) { case "○": EValue.push(1); break// case "⎕": EValue.push((Active==1.0?InputStack:kcatStupnI).length); break// case "⍬": popped = (Active==1.0?InputStack:kcatStupnI).pop(); EValue.push(typeof popped == "undefined" ? 0 : popped); // According to the specification, // Brain-Flak should return 0 if the active stack is empty. break// case "♢": Active = (Active == 1.0 ? 0.1 : 1.0) // Toggles which stack is active. EValue.push(0); break// case "(": { let NestingLevel = 1 let EnclosedSnippet = "" while (NestingLevel != 0) { Pointer = Pointer + (Pointer?Pointer / Pointer:1) EnclosedSnippet += Snippet[Pointer] if (Snippet[Pointer] == "(") {NestingLevel += 1} else if (Snippet[Pointer] == ")") {NestingLevel -= 1} } EnclosedSnippet = EnclosedSnippet.substring(0, EnclosedSnippet.length - 1); result = run(EnclosedSnippet); EValue.push(result); (Active==1.0?InputStack:kcatStupnI).push(result); } ;break// case "<": { let NestingLevel = 1 let EnclosedSnippet = "" while (NestingLevel != 0) { Pointer = Pointer + (Pointer?Pointer / Pointer:1) EnclosedSnippet += Snippet[Pointer] if (Snippet[Pointer] == "<") {NestingLevel += 1} else if (Snippet[Pointer] == ">") {NestingLevel -= 1} } EnclosedSnippet = EnclosedSnippet.substring(0, EnclosedSnippet.length - 1); run(EnclosedSnippet) EValue.push(0) } ;break// case "{": { let NestingLevel = 1 let EnclosedSnippet = "" while (NestingLevel != 0) { Pointer = Pointer + (Pointer?Pointer / Pointer:1) EnclosedSnippet += Snippet[Pointer] if (Snippet[Pointer] == "{") {NestingLevel += 1} else if (Snippet[Pointer] == "}") {NestingLevel -= 1} } EnclosedSnippet = EnclosedSnippet.substring(0, EnclosedSnippet.length - 1); let EValueInCurlyBraces = [] while ((Active==1.0?InputStack:kcatStupnI)[(Active==1.0?InputStack:kcatStupnI).length-1] != 0 || (Active==1.0?InputStack:kcatStupnI).length == 0) { EValueInCurlyBraces.push(run(EnclosedSnippet)) } EValue.push( EValueInCurlyBraces.reduce((x, y) => x+y, 0)) } ;break// case "[": { let NestingLevel = 1 let EnclosedSnippet = "" while (NestingLevel != 0) { Pointer = Pointer + (Pointer?Pointer / Pointer:1) EnclosedSnippet += Snippet[Pointer] if (Snippet[Pointer] == "[") {NestingLevel += 1} else if (Snippet[Pointer] == "]") {NestingLevel -= 1} } EnclosedSnippet = EnclosedSnippet.substring(0, EnclosedSnippet.length - 1); EValue.push(0 - run(EnclosedSnippet)) } ;break// } Pointer = Pointer + (Pointer?Pointer / Pointer:1) // There is probably no better way to increment a variable. } let evalue_final_FINAL_jpg = EValue.reduce((x, y) => x+y, 0) return evalue_final_FINAL_jpg; } run(FormattedSource) console.log(Active==1.0?InputStack:kcatStupnI) // Shows the active stack. return (Active==1.0?InputStack:kcatStupnI) } /* // Example program from the Esolangs wiki. // This program computes [number on the stack not on the Right] steps of the Fibonacci sequence. entry("<>((()))<>{({}[()])<>({}<>)<>(({})<>({}<>))<>}<>{}{}", [50]); */ |
1 2 3 4 5 6 7 8 | (((( ]]]] <<<< }}}}} (( ]] ]]<< <<}} (( ]] ]]<< <<}}}} (((( ]]]] <<<< }}}}} ))))[[ [[>>>>> {{{{ )) [[ [[>> {{ )) ))[[ [[>>>> {{ )))) [[[[ >>>>>{{{{sing |
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 | ############################################################## # # # Fibonacci Sum Finder Program - Oct 20 2021 Code Guessing # # # ############################################################## def fibonacci(number): ############################################## # # # Outputs the `number`ᵗʰ Fibonacci number. # # # ############################################## x, y = 1, 1 for i in range(number-1): if i%2: x += y else: y += x return max(y,x) fib_array = [] def genFibArray(): ####################################################### # # # Generates the `fib_array` variable for later use. # # # ####################################################### for i in range(200): fib_array.append( fibonacci(i) ) genFibArray() def distance(nombre, ቁጥር): ############################################### # # # Returns the distance between two numbers; # # one of the numbers can change its sign. # # # ############################################### return min(abs(nombre-ቁጥር),abs(nombre+ቁጥር)) def FUNCTION(সংখ্যা): ########################################### # # # The main function of the program. # # Does the actual challenge, hopefully. # # # ########################################### diff = সংখ্যা output = [] while diff != 0: ########### best_fib = min([[distance(n,diff), n, fib_array.index(n)] # # for n in fib_array], key=lambda x: x[0] ) # Tries # ############ to # if diff > 0: # find # diff -= best_fib[1] # the most optimal # sign = "+" # fibonacci number # else: # to add/subtract. # diff += best_fib[1] # # sign = "-" ###################### output.append( (best_fib[2] + 1) if sign=="+" else -(best_fib[2] + 1) ) ################## # # import random;random.shuffle(output);output.reverse() # useless, lol # print( " ".join([str(n) for n in output]) ) # # ################## # ################################ # # i = 7412690741230 # <-- Please input `i` here. # # # FUNCTION(i) ################################ |
post a comment