-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample.jl
More file actions
64 lines (53 loc) · 1.67 KB
/
Copy pathexample.jl
File metadata and controls
64 lines (53 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env julia
# Example usage of Swirl.jl
# This script demonstrates how to use the Swirl package
println("="^60)
println("Swirl.jl Example Usage")
println("="^60)
println()
# First, we need to add the package to the current environment
using Pkg
# Add the local package (adjust path as needed)
println("Loading Swirl.jl...")
Pkg.activate(".")
Pkg.develop(path=@__DIR__)
using Swirl
println("✓ Swirl.jl loaded successfully!")
println()
# Example 1: List available courses
println("Example 1: Listing available courses")
println("-"^60)
Swirl.list_courses()
# Example 2: Check available functions
println("\nExample 2: Available Swirl functions")
println("-"^60)
println(" swirl() - Start an interactive lesson")
println(" list_courses() - List all available courses")
println(" delete_progress() - Reset all progress")
println(" install_course() - Install a custom course (coming soon)")
println()
# Example 3: Understanding the course structure
println("\nExample 3: Exploring the Julia Basics course")
println("-"^60)
course = Swirl.create_basic_julia_course()
println("Course: $(course.name)")
println("Description: $(course.description)")
println("\nLessons:")
for (i, lesson) in enumerate(course.lessons)
println(" $i. $(lesson.name)")
println(" $(lesson.description)")
println(" Questions: $(length(lesson.questions))")
end
println()
# Instructions for interactive use
println("="^60)
println("To start learning interactively, run:")
println(" julia> using Swirl")
println(" julia> swirl()")
println("="^60)
println()
# Note about testing
println("To run tests:")
println(" julia> using Pkg")
println(" julia> Pkg.test(\"Swirl\")")
println()