добавила пакеты matrix, calculator
This commit is contained in:
28
repo/packages/calculator/files/usr/bin/calculator
Executable file
28
repo/packages/calculator/files/usr/bin/calculator
Executable 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}")
|
||||
13
repo/packages/calculator/meta.json
Normal file
13
repo/packages/calculator/meta.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "calculator",
|
||||
"version": "1.0",
|
||||
"description": "Простой калькулятор в терминале",
|
||||
"depends": [],
|
||||
"files": [
|
||||
{
|
||||
"source": "usr/bin/calculator",
|
||||
"destination": "/usr/bin/calculator",
|
||||
"permissions": 493
|
||||
}
|
||||
]
|
||||
}
|
||||
19
repo/packages/matrix/files/usr/bin/matrix
Executable file
19
repo/packages/matrix/files/usr/bin/matrix
Executable 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Дождь остановлен🌧️")
|
||||
13
repo/packages/matrix/meta.json
Normal file
13
repo/packages/matrix/meta.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "matrix",
|
||||
"version": "1.0",
|
||||
"description": "Матричный дождь из цифр в терминале",
|
||||
"depends": [],
|
||||
"files": [
|
||||
{
|
||||
"source": "usr/bin/matrix",
|
||||
"destination": "/usr/bin/matrix",
|
||||
"permissions": 493
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "nano",
|
||||
"version": "2.0",
|
||||
"description": "Тестовый текстовый редактор",
|
||||
"depends": [],
|
||||
"depends": ["libncurses"],
|
||||
"files": [
|
||||
{
|
||||
"source": "usr/bin/nano",
|
||||
|
||||
Reference in New Issue
Block a user