mirror of
https://github.com/csd4ni3l/logical-signals.git
synced 2026-01-01 12:33:46 +01:00
Remove bloat, add level selector and some basic levels that just create input and outputs currently, no checking, make tool box invisible during screenshot
This commit is contained in:
@@ -8,16 +8,34 @@ log_dir = 'logs'
|
||||
discord_presence_id = 1427213145667276840
|
||||
|
||||
LOGICAL_GATES = {
|
||||
"INPUT": lambda a: a,
|
||||
"AND": lambda a, b: a and b,
|
||||
"OR": lambda a, b: a or b,
|
||||
"NAND": lambda a, b: not (a and b),
|
||||
"NOR": lambda a, b: not (a or b),
|
||||
"XOR": lambda a, b: a != b,
|
||||
"XNOR": lambda a, b: a == b,
|
||||
"OUTPUT": lambda a: a
|
||||
}
|
||||
|
||||
LEVELS = [
|
||||
[
|
||||
[2, "INPUT", 1],
|
||||
[1, "AND"],
|
||||
[1, "OUTPUT", 1]
|
||||
],
|
||||
[
|
||||
[1, "INPUT", 1],
|
||||
[1, "INPUT", 0],
|
||||
[1, "AND"],
|
||||
[1, "OUTPUT", 0]
|
||||
],
|
||||
[
|
||||
[1, "INPUT", 0],
|
||||
[1, "INPUT", 1],
|
||||
[1, "OR"],
|
||||
[1, "OUTPUT", 1]
|
||||
]
|
||||
]
|
||||
|
||||
button_style = {'normal': UITextureButtonStyle(font_name="Roboto", font_color=arcade.color.BLACK), 'hover': UITextureButtonStyle(font_name="Roboto", font_color=arcade.color.BLACK),
|
||||
'press': UITextureButtonStyle(font_name="Roboto", font_color=arcade.color.BLACK), 'disabled': UITextureButtonStyle(font_name="Roboto", font_color=arcade.color.BLACK)}
|
||||
big_button_style = {'normal': UITextureButtonStyle(font_name="Roboto", font_color=arcade.color.BLACK, font_size=26), 'hover': UITextureButtonStyle(font_name="Roboto", font_color=arcade.color.BLACK, font_size=26),
|
||||
|
||||
@@ -4,8 +4,13 @@ from utils.constants import menu_background_color
|
||||
|
||||
import pyglet.display
|
||||
|
||||
def lerp(a, b, t):
|
||||
return a + (b - a) * t
|
||||
def generate_task_text(level):
|
||||
text = "Task: You need to use "
|
||||
|
||||
text += f"{', '.join([f'{requirement[0]} {requirement[1]} gate(s)' for requirement in level if not requirement[1] in ['INPUT', 'OUTPUT']])}"
|
||||
text += f" to result in {', '.join([f'{requirement[0]} OUTPUT gate(s) with value {requirement[2]}' for requirement in level if requirement[1] == 'OUTPUT'])}"
|
||||
|
||||
return text
|
||||
|
||||
def cubic_bezier_point(p0, p1, p2, p3, t):
|
||||
u = 1 - t
|
||||
|
||||
Reference in New Issue
Block a user