name | correct guesses | games together | ratio |
---|---|---|---|
ponydork | 4 | 6 | 0.667 |
Moja | 2 | 4 | 0.500 |
yeti | 3 | 6 | 0.500 |
Dolphy | 3 | 7 | 0.429 |
kimapr | 2 | 5 | 0.400 |
Makefile_dot_in | 3 | 9 | 0.333 |
essaie | 2 | 6 | 0.333 |
moshikoi | 1 | 4 | 0.250 |
taswelll | 1 | 4 | 0.250 |
rrebbbbeca | 1 | 5 | 0.200 |
name | correct guesses | games together | ratio |
---|---|---|---|
essaie | 5 | 6 | 0.833 |
yeti | 2 | 6 | 0.333 |
Dolphy | 2 | 7 | 0.286 |
moshikoi | 1 | 4 | 0.250 |
taswelll | 1 | 4 | 0.250 |
ponydork | 1 | 6 | 0.167 |
kimapr | 0 | 4 | 0.000 |
Makefile_dot_in | 0 | 9 | 0.000 |
rrebbbbeca | 0 | 5 | 0.000 |
submitted at
0 likes
1 2 3 4 5 6 7 8 9 10 11 12 13 | :Disp "-I0 :Disp "-I2 :Disp "-J0 :Disp "-I5 :Disp "-J4 : :For(X,1,10 :For(Y,1,10 :Disp sub("ABCDEFGHIJ",X,1)+sub("0123456789",Y,1 :Input Z :End :End :End |
submitted at
0 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 | import processing.core.*; import processing.data.*; import processing.event.*; import processing.opengl.*; import java.util.HashMap; import java.util.ArrayList; import java.io.File; import java.io.BufferedReader; import java.io.PrintWriter; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; public class circle extends PApplet { int psize = 500; double x; double y; double theta; int depth = 10; int dots = 200; long fact; public void settings(){ size(psize, psize); } public void setup(){ for (int i = 0; i < dots; i++) { theta = i * 2 * Math.PI / dots; x = 0; y = 0; for (int n = 0; n < depth; n++){ fact = 1; for (int k = 2*n; k > 0; k-=1) fact *=k; x+= Math.pow(-1, n) * Math.pow(theta, 2 * n) / fact; y+= Math.pow(-1, n) * Math.pow(theta, 2 * n + 1) / fact / (2 * n + 1); } ellipse((int)((x * 0.9f + 1) * (psize / 2)), (int)((y * 0.9f + 1) * (psize / 2)), (int) (psize / 100), (int) (psize / 100)); } } static public void main(String[] passedArgs) { String[] appletArgs = new String[] { "circle" }; if (passedArgs != null) { PApplet.main(concat(appletArgs, passedArgs)); } else { PApplet.main(appletArgs); } } } |
submitted at
0 likes
1 | =IF(ROW()=1, 1, IF(COUNTIF(INDIRECT("A1"):INDIRECT("A"&ROW()-1), MAX(INDIRECT("A1"):INDIRECT("A"&ROW()-1)))<INDIRECT("A"&MAX(INDIRECT("A1"):INDIRECT("A"&ROW()-1))), MAX(INDIRECT("A1"):INDIRECT("A"&ROW()-1)), MAX(INDIRECT("A1"):INDIRECT("A"&ROW()-1))+1)) |
submitted at
1 like
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 | use std::io; fn main() { println!("This is a full recreation of the official Warrior Cats clan quiz. https://web.archive.org/web/20140413215631/http://www.warriorcats.com/games-and-extras/extras/starclan-clanname "); let questions = vec![ "1. Following the rules is important to you", "2. You like decorating your room with posters and stickers", "3. Your friends consider you a fast runner", "4. If a classmate was unfairly accused of cheating you would help defend their reputation", "5. You prefer to keep to yourself", "6. If at first you don't succeed, try, try again", "7. During the summer you like to spend as much time swimming as possible", "8. You like to stay up late at night", "9. You snooze, you lose", "10. You can easily sneak up on a friend without them hearing", "11. You enjoy board games and cross-word puzzles", "12. You would always rather be outside in the fresh air", "13. If you were at a theme park with your friends, you would be the first try the scariest roller coaster", "14. You dream of one day owning a boat", "15. You prefer to wear black over any other color", "16. Loyalty in a friendship is very important to you This is your last question. Time to consult StarClan"]; let clans = vec![ "Based on your answers, StarClan has determined your belong in ThunderClan. You are a member of the ThunderClan. You are brave and loyal and will always stand up for what is right.", "Based on your answers, StarClan has determined your belong in RiverClan. You are a member of the RiverClan. You are clever and graceful and love the beauty of water.", "Based on your answers, StarClan has determined your belong in WindClan. You are a member of the WindClan. You are swift and loyal and love being outside to smell the fresh air.", "Based on your answers, StarClan has determined your belong in ShadowClan. You are a member of the ShadowClan. You are ambitious and proud and enjoy being independent."]; let key = vec![0, 1, 2, 0, 3, 2, 1, 3, 3, 0, 1, 2, 0, 1, 3, 2]; loop{ println!("Answer these questions to find out what Clan StarClan thinks you belong in"); let mut score = vec![0, 0, 0, 0]; let mut answer = String::new(); for question in 0..16 { println!("{}", questions[question]); loop{ println!("Please answer 1 (Strongly Disagree), 2 (Disagree), 3 (Neutral), 4 (Agree), or 5 (Strongly Agree)"); answer = String::new(); io::stdin().read_line(&mut answer); if answer.trim() == "1"{score[key[question]] = score[key[question]]-2; break;} if answer.trim() == "2"{score[key[question]] = score[key[question]]-1; break;} if answer.trim() == "3"{break;} if answer.trim() == "4"{score[key[question]] = score[key[question]]+1; break;} if answer.trim() == "5"{score[key[question]] = score[key[question]]+2; break;} } } let mut win = 0; for i in 1..4 { if score[i] > score[win]{win = i;} } let mut result = clans[win]; for i in 0..4 { if score[i] == score[win] && i!=win{result = "StarClan is unable to determine your clan at this time. Try again. ";} } println!("{}", result); if result.starts_with("Based"){break;} } } |
submitted at
1 like
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 os import requests t='bottoken' c='channelid' n='The Most Wanted Person In The United States.mp3' f=open(n,'rb') h={'authorization' :'Bot '+t} s=os.path.getsize(n) u='https://discord.com/api/v10/channels/'+str(c)+'/messages' a='https://discord.com/api/v10/channels/'+str(c)+'/attachments' l={"files":[{"filename":n,"file_size":s,"id":"0"}]} r=requests.post(a,headers=h,json=l) o=r.json()['attachments'][0]['upload_url'] m=r.json()['attachments'][0]['upload_filename'] d={'Content-Length':str(s),'Connection':'keep-alive','Content-Type':'audio/mp3','authorization' :'Bot '+t} p=requests.put(o,headers=d,data=f) i={"attachments":[{"id":"0","filename":n,"uploaded_filename":m}]} p=requests.post(u,headers=h,json=i) f.close() |
submitted at
0 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 | <!DOCTYPE html> <html> <head> <title>CG 73</title> </head> <body> <p id='chatbox' style='font-family: monospace;position:absolute;bottom:20px;'></p> <span style='position:absolute;bottom:5px;'> <input type='text' id='typebox' placeholder='type here!'> </input> </span> </body> <script> document.getElementById('typebox').onkeydown = function (e) {if (e.key == 'Enter') { send(); }}; function datasend(socket, data) {socket.send(JSON.stringify(data))} var wsurl = 'wss://codeguessing.gay/73/ws'; let socket = new WebSocket(wsurl); socket.onerror = function() {window.alert('ERROR CONNECTING TO SERVER')} socket.onmessage = function (message) { console.log(message.data) returndata = JSON.parse(message.data); name = returndata['name'] color = name.slice(0,name.indexOf('_')); if (returndata['reason'] == 'connect') { newtext=('<b><span style="color:'+color+';">'+name+' connected'+'</span></b><br>') write(newtext)} if (returndata['reason'] == 'disconnect') { newtext=('<b><span style="color:'+color+';">'+name+' disconnected'+'</span></b><br>') write(newtext)} if (returndata['reason'] == 'message') { newtext=('<b><span style="color:'+color+';">'+name+'</span></b> '+returndata['content']+'<br>') write(newtext)} } function write(newtext){ document.getElementById('chatbox').innerHTML=document.getElementById('chatbox').innerHTML+newtext; } function send() { message=document.getElementById("typebox").value if (message!=''){ document.getElementById("typebox").value=''; var newmessage = {'content': message} datasend(socket, newmessage)} } </script> |
submitted at
0 likes
submitted at
0 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 | coded_message = "mrrp mrrrp meow meow mew meow :3" frequency_dict = {} for character in coded_message: if character in frequency_dict: frequency_dict[character]+= 1 else: frequency_dict[character]= 1 sorted_key = [] sorted_val = [] for character in frequency_dict: pointer = 0 for i in sorted_key: if frequency_dict[i] < frequency_dict[character]: pointer+=1 else: break sorted_key.insert(pointer, character) sorted_val.insert(pointer, frequency_dict[character]) encoded_key = {i:"" for i in frequency_dict} for i in range(0, len(frequency_dict)-1): first_key = sorted_key.pop(0) first_val = sorted_val.pop(0) second_key = sorted_key.pop(0) second_val = sorted_val.pop(0) for character in second_key: encoded_key[character]="0"+encoded_key[character] for character in first_key: encoded_key[character]="1"+encoded_key[character] new_key = first_key+second_key new_val = first_val+second_val pointer = 0 for i in sorted_val: if i < new_val: pointer+=1 else: break sorted_key.insert(pointer, new_key) sorted_val.insert(pointer, new_val) encoded_message = "" for character in coded_message: encoded_message += encoded_key[character] print(encoded_message) for character in encoded_key: print(character + "\t" + encoded_key[character]) |
submitted at
1 like
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 | async function go(dir, num) {for (let i = 0; i < num; i++) { //await fetch("/extra/game70", { method: "POST", body: JSON.stringify({dir}), headers, }); fetch("/extra/game70", {method: "POST", body: JSON.stringify({dir}), headers, }); }} async function get() { grabbed = await fetch("/extra/game70", {method: "GET", headers,}); grid = await grabbed.json(); return await grid['grid']; } for (let i = 0; i < 3000; i++) { grid = await get(); px = grid.indexOf('@') % 16; py = Math.floor(grid.indexOf('@') / 16); gx = grid.indexOf('+') % 16; gy = Math.floor(grid.indexOf('+') / 16); kx = grid.indexOf('*') % 16; ky = Math.floor(grid.indexOf('*') / 16); console.log(px, py, gx, gy, kx, ky); if (ky != py) { await go(px < gx ? 'right' : 'left', Math.abs(px - gx)); await go(py < gy ? 'down' : 'up', Math.abs(py - gy)); } else { await go(py < gy ? 'down' : 'up', Math.abs(py - gy)); await go(px < gx ? 'right' : 'left', Math.abs(px - gx)); } } |
submitted at
0 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 | #include <iostream> #include <cmath> using namespace std; int main() { double iterations = 10000; cout << "Enter a positive value:" << endl; double target; double result; cin >> target; cout << "Target value: " << target << endl << endl; double final_a = 0; double final_b = 1; double final_result = 1.0; for (int a = 0; a < iterations; a++) { for (int b = 1; b < iterations; b++) { double result = exp(a) / b; if (abs(target - result) < abs(target - final_result)) { final_a = a; final_b = b; final_result = result; } } } cout << "e^" << final_a << "/" << final_b << "=" << final_result << endl; cout << abs(target - final_result) << " from target value" << endl << endl; final_a = 1; final_b = 1; final_result = M_PI; for (int a = 1; a < iterations; a++) { for (int b = 1; b < iterations; b++) { double result = a * M_PI / b; if (abs(target - result) < abs(target - final_result)) { final_a = a; final_b = b; final_result = result; } } } cout << final_a << "π/" << final_b << "=" << final_result << endl; cout << abs(target - final_result) << " from target value" << endl <<endl; } |
submitted at
0 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 | #this code doesnt actually work 😇 cm = 'Uif rvjdl cspxo gpy kvnqt pwfs uif mbaz eph.' wlf = open('wordlist.txt', 'r') wl = wlf.read().split('\n') wlf.close() abc='abcdefghijklmnopqrstuvwxyz' punct=['!','.','-',',',';','?','\n','\t'] wld={} cfd={i:1 for i in abc} for i in wl: for c in i: if not c.lower() in abc: break else: if len(i) in wld: wld[len(i)].append(i.lower()) else: wld[len(i)]=[i.lower()] for c in i: cfd[c]+=1 cm=cm.lower() for i in punct: cm=cm.replace(i, '') cms = set(list(cm.replace(' ',''))) cml = cm.split(' ') fwd={i:{j:0 for j in abc} for i in cms} for w in cml: for p in wld[len(w)]: cd = {} for c in range(0, len(w)): if w[c] in cd: if cd[w[c]]==p[c]: continue else: break else: cd[w[c]]=p[c] else: for j in cd: fwd[j][cd[j]]+=1 iwd={i:'a' for i in cms} for i in cms: for j in fwd[i]: if (fwd[i][j]/cfd[j])>(fwd[i][iwd[i]]/cfd[iwd[i]]): #if (fwd[i][j])>(fwd[i][iwd[i]]): iwd[i]=j ncm=list(cm.lower()) for i in range(0,len(ncm)): if ncm[i] in iwd: ncm[i]=iwd[ncm[i]] ncm = ''.join(ncm) print(ncm) |
post a comment