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
| import os | |
| import sublime | |
| from sublime_plugin import ApplicationCommand | |
| # This is an adaption of the 'toggle_setting_ext' plugin snippet at: | |
| # https://github.com/STealthy-and-haSTy/SublimeScraps/blob/fc2eaff26f45b7aa94fe3cadc8cbd3e15b1361d6/plugins/toggle_setting_ext.py | |
| # Notable changes are that this version is named 'cycle_setting', and that the | |
| # setting cycled now persists across windows, views, and reloads. Most of the | |
| # rest is copied verbatim from the above link. Much thanks to STealthy-and-haSTy! |
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
| def get_n_primes(n: int = 100) -> list[int]: | |
| retval = [2] | |
| i = 3 | |
| while len(retval) < n: | |
| if is_prime(i): | |
| retval.append(i) | |
| i += 2 | |
| return retval |
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
| ########################################################################################### | |
| # Testing of solutions to The Three Indistinguishable Dice Puzzle | |
| # Copyright (C) 2016 Nathan Sullivan <contact@torrentails.com> | |
| # This program is licened under The WTFPL available at http://www.wtfpl.net/about/ | |
| # | |
| # The puzzle was presented by Matt Parker on his YouTube chanel, standupmaths | |
| # https://youtu.be/xHh0ui5mi_E | |
| # | |
| # The first soulution here was presented by Katie and Paul here: | |
| # https://youtu.be/Hfw8bB82-ps |