Last active
April 18, 2020 10:07
-
-
Save AvverbioPronome/262cab7c65d7c0d5912b76717beaee3d to your computer and use it in GitHub Desktop.
keeptalking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.ipynb_checkpoints/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"# Queste sono le parole del manuale\n", | |
"words = \"\"\"\n", | |
"abaco aceto adoro balzo capra\n", | |
"dacci danno danza detto dieci\n", | |
"dieta entro festa fiera gnomo\n", | |
"hotel largo latte nuoto opera\n", | |
"pizza posto pozzo radio salve\n", | |
"salvi scudo secco sigla tanto\n", | |
"tempo tetro tetto tosse tozzo\"\"\"\n", | |
"\n", | |
"def risolvi(lettermatrix):\n", | |
" lettermatrix=lettermatrix.lower()\n", | |
" def test_one_word(word):\n", | |
" return all([word[i] in lettermatrix.split()[i] for i in range(5)])\n", | |
" return filter(test_one_word, words.split())" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"dieci\n" | |
] | |
} | |
], | |
"source": [ | |
"# Queste sono le lettere della combinazione, prima lettera è\n", | |
"# la prima _riga_, seconda lettera seconda riga, etc\n", | |
"lettermatrix=\"\"\"\n", | |
"PDFMGV\n", | |
"DZPLTI\n", | |
"QHBVFE\n", | |
"COAQFB\n", | |
"ISZTMM\"\"\"\n", | |
"\n", | |
"for a in risolvi(lettermatrix):\n", | |
" print(a)" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.7.6" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 4 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment