добавила пакеты matrix, calculator

This commit is contained in:
2026-05-26 09:31:03 +03:00
parent dbdd5cd26d
commit 70c5e441ae
5 changed files with 74 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
#!/usr/bin/env python3
import sys
if len(sys.argv) != 4:
print("Использование: calculator <число> <оператор> <число>")
print("Пример: calculator 5 + 3")
sys.exit(1)
a, op, b = sys.argv[1], sys.argv[2], sys.argv[3]
try:
a = float(a)
b = float(b)
except ValueError:
print("❌ Ошибка: введите числа")
sys.exit(1)
if op == '+':
result = a + b
elif op == '-':
result = a - b
elif op == '*':
result = a * b
elif op == '/':
result = a / b if b != 0 else "деление на ноль"
else:
result = "неизвестный оператор"
print(f"📊 Результат: {a} {op} {b} = {result}")

View File

@@ -0,0 +1,13 @@
{
"name": "calculator",
"version": "1.0",
"description": "Простой калькулятор в терминале",
"depends": [],
"files": [
{
"source": "usr/bin/calculator",
"destination": "/usr/bin/calculator",
"permissions": 493
}
]
}

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env python3
import random
import time
import sys
colors = [32, 33, 34, 35, 36, 37]
chars = "01"
try:
while True:
for _ in range(random.randint(5, 20)):
for __ in range(random.randint(1, 10)):
color = random.choice(colors)
sys.stdout.write(f"\033[{color}m{random.choice(chars)}\033[0m")
sys.stdout.write(" ")
sys.stdout.write("\n")
time.sleep(0.05)
except KeyboardInterrupt:
print("\n\033[0mДождь остановлен🌧️")

View File

@@ -0,0 +1,13 @@
{
"name": "matrix",
"version": "1.0",
"description": "Матричный дождь из цифр в терминале",
"depends": [],
"files": [
{
"source": "usr/bin/matrix",
"destination": "/usr/bin/matrix",
"permissions": 493
}
]
}

View File

@@ -2,7 +2,7 @@
"name": "nano",
"version": "2.0",
"description": "Тестовый текстовый редактор",
"depends": [],
"depends": ["libncurses"],
"files": [
{
"source": "usr/bin/nano",