mooc/filesystem/usr/evalp1/evalQ411

48 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
#xcrypted
# Auteur: Pascal Anelli
# adaptation session 2 : Denis Payet
# modification session 3: pascal ANELLI
# version 23 mars 2020
source ${LIBSH}/libeval.sh
#--------------------
rep=~/Sequence4/A41
challenge=C41Q1
scriptname=alea50.sh
exo=$rep/$scriptname
#---------------------------------
# codechecker 12 $challenge
# Debut
firstcheck
# 1 RANDOM
grep -q RANDOM $rep/$scriptname 2>/dev/null
step $(vraifaux $?) "Le script va generer un nombre aleatoire "
# 2 Working
$rep/$scriptname &>/dev/null
step $(vraifaux $?) "Le script fonctionne "
# numbers
for i in {1..5}
do
number=$($rep/$scriptname 2>/dev/null)
isinteger "$number"
step $(vraifaux $?) "Le tirage $i (nombre = $number) est un entier " true
[ "$number" -ge 0 -a "$number" -lt 50 ]
step $(vraifaux $?) "Le tirage $i est dans l'intervalle [0; 50[ "
done
#-----------------------------------------
# Fin
status "${challenge}_$res"
exit 0
# listcode = [ '000', 'dfa', '6cf', '2b4', '201', '9ab', 'adc', '389', '8f0', 'c16', 'ae0', 'b16', '6fb' ]