all stats

oleander's stats

guessed the most

namecorrect guessesgames togetherratio
Dolphy240.500

were guessed the most by

namecorrect guessesgames togetherratio
Dolphy240.500

entries

round #71

submitted at
0 likes

guesses
comments 0

post a comment


codeguessing71_huffman.py ASCII text, with CRLF line terminators
 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])

round #70

submitted at
1 like

guesses
comments 0

post a comment


temp.js ASCII text, with CRLF line terminators
 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));
}
}

round #69

submitted at
0 likes

guesses
comments 2
essaie

ollie why do u redeclare everything like a bajillion times (twice at most)


oleander

i think the only one i redeclared was result once? the original version of the code definitely had a lot of more of that (grrr c++....) but i cleaned it up a lot when I added the formatting


post a comment


main.cpp Unicode text, UTF-8 text
 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;

}

round #68

submitted at
0 likes

guesses
comments 0

post a comment


week68.py Unicode text, UTF-8 text, with CRLF line terminators
 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)