{"id":10799,"date":"2014-07-04T12:25:51","date_gmt":"2014-07-04T17:25:51","guid":{"rendered":"http:\/\/blog.espol.edu.ec\/ccpg1001\/?p=10799"},"modified":"2026-04-05T18:14:05","modified_gmt":"2026-04-05T23:14:05","slug":"s2eva2011tii_t2-ubicar-ficha-en-tablero","status":"publish","type":"post","link":"https:\/\/blog.espol.edu.ec\/algoritmos101\/fp-s2eva20\/s2eva2011tii_t2-ubicar-ficha-en-tablero\/","title":{"rendered":"s2Eva2011TII_T2 Ubicar ficha en tablero"},"content":{"rendered":"\n<p><strong>Ejercicio<\/strong>: <a href=\"https:\/\/blog.espol.edu.ec\/algoritmos101\/fp-2eva20\/2eva2011tii_t2-ubicar-ficha-en-tablero\/\" data-type=\"post\" data-id=\"2977\">2Eva2011TII_T2 Ubicar ficha en tablero<\/a><\/p>\n\n\n\n<p>Resultado obtenido<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; ubicaficha(6,8)\narray(&#091;&#091;0, 0, 0, 0, 0, 0, 0, 0],\n       &#091;0, 0, 0, 0, 0, 0, 0, 0],\n       &#091;0, 0, 5, 0, 3, 0, 0, 0],\n       &#091;0, 0, 0, 0, 0, 0, 0, 0],\n       &#091;0, 0, 0, 0, 7, 0, 4, 0],\n       &#091;0, 0, 0, 0, 0, 0, 0, 0],\n       &#091;0, 0, 6, 0, 0, 0, 0, 0],\n       &#091;0, 0, 2, 0, 0, 0, 0, 0]])\n&gt;&gt;&gt; <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Algoritmo en Python<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# 2Eva_IIT2011_T2 Ubicar ficha en tablero\nimport numpy as np\nimport random as rnd\n\ndef ubicaficha(m,n):\n    campo = np.zeros(shape=(n,n),dtype=int)\n    \n    bomba = 2\n    while not(bomba&gt;m+1):\n        fila = int(rnd.random()*n)+0\n        columna = int(rnd.random()*n)+0\n        \n        if (campo&#x5B;fila,columna] == 0):\n            campo&#x5B;fila,columna] = bomba\n            bomba = bomba + 1\n            \n    return(campo)\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Ejercicio: 2Eva2011TII_T2 Ubicar ficha en tablero Resultado obtenido Algoritmo en Python<\/p>\n","protected":false},"author":8043,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"wp-custom-template-entrada-fp-ejemplos","format":"standard","meta":{"footnotes":""},"categories":[136],"tags":[58,157],"class_list":["post-10799","post","type-post","status-publish","format-standard","hentry","category-fp-s2eva20","tag-ejemplos-python","tag-fundamentos-programacion"],"_links":{"self":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts\/10799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/users\/8043"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/comments?post=10799"}],"version-history":[{"count":4,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts\/10799\/revisions"}],"predecessor-version":[{"id":23707,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts\/10799\/revisions\/23707"}],"wp:attachment":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/media?parent=10799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/categories?post=10799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/tags?post=10799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}