This file contains hidden or 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
| javascript:(()=>{const f=Array.prototype.find,p=Array.prototype.push,S=new Set(['Shadow']),R=/^Icon/;let m=null,a=1;Array.prototype.find=function(g){const r=f.call(this,g);if(a&&r&&r.id==='Secret'&&Array.isArray(this)){m=this;const d=f.call(this,c=>c&&c.id==='Dev');if(d)return d}return r};Array.prototype.push=function(...i){if(a&&m&&i.length===1&&i[0]&&i[0].id==='Dev'&&Array.isArray(this)&&this!==m&&!this.some(c=>c.id==='Dev')){a=0;const ic=this.some(c=>c&&R.test(c.id||''));for(const c of m){if(!c||!c.id||c.id==='Dev'||S.has(c.id))continue;if(ic?!R.test(c.id):R.test(c.id))continue;if(this.some(n=>n&&n.id===c.id))continue;try{c.init&&c.init()}catch{}i.push(c)}queueMicrotask(()=>{Array.prototype.find!==f&&(Array.prototype.find=f);Array.prototype.push!==p&&(Array.prototype.push=p)})}return p.apply(this,i)};for(const c of'IDDQD'){document.dispatchEvent(new KeyboardEvent('keydown',{key:c,bubbles:!0}));document.dispatchEvent(new KeyboardEvent('keyup',{key:c,bubbles:!0}))}setTimeout(()=>{Array.prototype.find!==f&&(A |
This file contains hidden or 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
| test |
This file contains hidden or 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
| """ | |
| EDUCUP 2025 MASTERS Challenge | |
| Attila Farago | |
| """ | |
| #region INIT_AND_UTILS | |
| from pybricks.hubs import InventorHub | |
| from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor |
This file contains hidden or 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
| from pybricks.hubs import PrimeHub | |
| from pybricks.iodevices import PUPDevice | |
| from pybricks.parameters import Button, Color, Port | |
| from pybricks.tools import wait, StopWatch | |
| from usys import version, implementation, stdin, stdout | |
| # Information that would be useful to be added later | |
| # # hub.display.status() | |
| # # hub.light.status() |
This file contains hidden or 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
| # Advanced two digit display for SPIKE prime | |
| # Created by Attila Farago, attilafarago.hu, 2024 | |
| # | |
| # inspired by Antons Mindstorms blog and PyBricks | |
| # https://www.antonsmindstorms.com/2021/02/08/how-to-display-two-digit-numbers-on-a-5x5-led-matrix-with-lego-spike-prime-or-robot-inventor/ | |
| from pybricks.hubs import PrimeHub | |
| from pybricks.tools import wait, Matrix, vector | |
| from pybricks.parameters import Button |