Skip to content

Commit

Permalink
[ADD] New subject : Pediluve
Browse files Browse the repository at this point in the history
  • Loading branch information
Nellypal committed Feb 5, 2024
1 parent b3e80f9 commit dc77ce9
Show file tree
Hide file tree
Showing 25 changed files with 409 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Pediluve/Cobra/bash/clockroomCleaner.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

count_charo=$(ls Iseg/ | grep 'a$' | wc -l)

count_iseg_ladies=$(ls Epitech/ | grep 'z$' | wc -l)

if [ $count_charo -gt 0 ]; then
mv Iseg/*a Epitech/
fi

if [ $count_iseg_ladies -gt 0 ]; then
mv Epitech/*z Iseg/
fi

12 changes: 12 additions & 0 deletions Pediluve/Cobra/bash/countCharo.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

count_iseg_ladies=$(ls Iseg/ | grep 'a$' | wc -l)

if [ $count_iseg_ladies -eq 0 ]; then
statut=0
else
statut=$count_iseg_ladies
fi

exit $statut

12 changes: 12 additions & 0 deletions Pediluve/Cobra/bash/getStatus.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

prec=$1

if [ "$prec" -eq 0 ]; then
echo "Les pieds sont propres !"
else
echo "T'as de ces ieps chacal..."
fi


echo "export PATH=$(pwd):\$PATH" >> ~/.bashrc
27 changes: 27 additions & 0 deletions Pediluve/Cobra/pyhton/circle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/python3
import math
import sys

def draw_circle_outline(radius):
if radius < 1:
print("Radius trop petit :(")
return

for y in range(2 * radius + 1):
row = ""
for x in range(2 * radius + 1):
distance = math.sqrt((x - radius) ** 2 + (y - radius) ** 2)
if math.isclose(distance, radius, abs_tol=0.5):
row += "*"
else:
row += " "
print(row)

if len(sys.argv) != 2:
print("Utilisation : python circle.py <rayon>")
else:
try:
radius = int(sys.argv[1])
draw_circle_outline(radius)
except ValueError:
print("Le rayon doit être un nombre entier.")
Loading

0 comments on commit dc77ce9

Please sign in to comment.