updated project 2

This commit is contained in:
Hugh Ratsch
2025-02-09 02:33:45 -06:00
parent 37c1f9c1c9
commit 8988f308c5
5 changed files with 79 additions and 48 deletions
@@ -11,10 +11,9 @@ declare -A CHALLENGE_CATEGORIES=(
["net"]="Network Operations"
)
# Challenge definitions with detailed metadata
# Challenge definitions with metadata
# Format: type|name|difficulty|skills|task|hints|setup_requirements|verification_criteria
declare -A CHALLENGES=(
# Level 1: File Operations
["1.1"]="file_search|Find Recent Files|1|file_ops,search|Find all .conf files modified in the last 24 hours and save the list to recent_configs.txt|Try using find with -mtime|none|output_file=recent_configs.txt;file_count=10"
["1.2"]="file_count|File Statistics|1|file_ops,search|Generate a report showing count of files by extension|Consider using find and awk|none|report_exists=true;extension_count=5"
["1.3"]="file_organize|Smart File Organizer|2|file_ops|Create directories for different file types and sort files accordingly|Look into file command|none|dir_structure=complete;files_sorted=true"
@@ -223,18 +222,18 @@ calculate_bonus_points() {
echo $((time_bonus + efficiency_bonus))
}
# Get challenge details with color formatting
# Get challenge details
get_challenge_details() {
local challenge_id=$1
IFS='|' read -r type name difficulty skills task hints requirements _ <<< "${CHALLENGES[$challenge_id]}"
cat << EOF
${BOLD}Challenge ${challenge_id}${NC}: ${YELLOW}$name${NC}
${BLUE}Difficulty${NC}: $(printf '★%.0s' $(seq 1 "$difficulty"))
${BLUE}Skills${NC}: $skills
${BLUE}Task${NC}: $task
${BLUE}Hint${NC}: $hints
EOF
if [[ -n "${CHALLENGES[$challenge_id]:-}" ]]; then
IFS='|' read -r type name difficulty skills task hints requirements criteria <<< "${CHALLENGES[$challenge_id]}"
echo -e "${BLUE}Challenge $challenge_id:${NC} $name"
echo -e "${BLUE}Difficulty:${NC} $(printf '★%.0s' $(seq 1 "$difficulty"))"
echo -e "${BLUE}Skills:${NC} $skills"
echo -e "${BLUE}Task:${NC} $task"
return 0
fi
return 1
}
# Update challenge status
@@ -254,10 +253,10 @@ update_challenge_status() {
# List available challenges
list_challenges() {
echo -e "\n${BOLD}Available Challenges:${NC}"
echo -e "\n${BLUE}Available Challenges:${NC}"
for challenge_id in "${!CHALLENGES[@]}"; do
IFS='|' read -r type name difficulty skills task hints requirements _ <<< "${CHALLENGES[$challenge_id]}"
if ! is_challenge_completed "$challenge_id"; then
IFS='|' read -r type name difficulty skills task _ <<< "${CHALLENGES[$challenge_id]}"
echo -e "\n${YELLOW}Challenge $challenge_id${NC} ($difficulty★)"
echo "Type: $type"
echo "Skills: $skills"