summaryrefslogtreecommitdiffstats
path: root/mat/fmf/fmf.py
blob: 87a50c339017a2000e3eaa6a3510f8fae44ad568 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/python3
import numpy
a = "abcčdefghijklmnopqrsštuvwxyzžABCČDEFGHIJKLMNOPQRSŠTUVZŽ.,-"
u = "Y-TČTNŽOF-MQUWMA-FINF-METRRJJLIWUŠVZQŠ.X-Č-GNSSIGPŽKOUUZNMFF-MNYQCXATSUGGLZJNHKIEFVULLDZTUBRŠB-ČRQHUNPVQQGPOJ.BBAYČ.VMRXGČF-MOCJQPDLGAOSKELŠ-AIŠPKATOŠŽOLZRKWUUZNMFF-M-TRZFAWBŽVŠV_"
n = "Y-TČtNžof-mQUWMA-FINf-mEtRrJjLIWušvzQš.X-č-gnssIGPžkOuuzNmFf-mNYQcxatsuGGLzjNhkiEFvuLlDZtuBršb-ČrQHunpvqQgPOJ.bbaYč.vMrxgčf-mOcJQpDlGaoSKElš-aIšpkatOšžOLZrkwuuzNmFf-m-TrzFAwBžVŠV_"
t = "Matematika-je-kul."
if n.upper() != u:
	raise Exception
k = [
	[1, 1, 1],
	[0, 3, 1],
	[2, 0, 1]]
v = [[], [], []]
s = -1
for i in range(len(t)):
	if s != i//3:
		s = i//3
		for j in range(3):
			v[j].append(-1)
	v[i%3][i//3] = a.find(t[i])
print(numpy.dot(k, v))

## ne znam matematike