Target (originally 24) | Number of Solutions |
---|---|
2 | 479 |
3 | 469 |
6 | 462 |
1 | 462 |
5 | 459 |
4 | 457 |
7 | 454 |
9 | 448 |
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
from nio.block import blockify | |
@blockify | |
def my_custom_block(signals): | |
for signal in signals: | |
setattr(signal, 'matt', 'dodge') | |
return signals |
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
from nio.block.base import Block | |
from nio.command import command | |
@command('set_warning') | |
@command('set_error') | |
@command('set_ok') | |
class StatusBlock(Block): | |
def set_warning(self): |
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
# Usage: | |
# From your nio project directory: | |
# >>> python unused_blocks.py | |
# | |
# Or, to delete the unused blocks: | |
# >>> python unused_blocks.py --delete | |
import json | |
import os | |
from os.path import join | |
import sys |
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
# Usage: From your nio project root run: | |
# | |
# python duplicate_blocks.py | |
from copy import copy | |
import json | |
import os | |
from os.path import join | |
blocks = {} |
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
% import our CLP library for constraint declarations | |
:- use_module(library(clpfd)). | |
% A Claimant is a liar if their age is over the threshold. We also | |
% explicitly declare the "not liar" condition here since `not` seems | |
% to behave weirdly with constraints | |
liar(Claimant, LieThreshold) :- Claimant #>= LieThreshold. | |
not_liar(Claimant, LieThreshold) :- Claimant #< LieThreshold. | |
% A Person is older than an Age if the Claimaint is not a liar, otherwise |
OlderNewer