@@ -107,86 +107,14 @@ fn main() -> anyhow::Result<()> {
107107
108108 // Show loading screen during startup
109109 let loading_screen = match LoadingScreen :: new ( ) {
110- Ok ( screen) => {
111- screen. show_initial ( ) . unwrap_or_else ( |e| eprintln ! ( "Loading screen error: {}" , e) ) ;
112- screen
113- } ,
110+ Ok ( screen) => screen,
114111 Err ( e) => {
115- eprintln ! ( "Failed to initialize loading screen: {}, using fallback progress reporter..." , e) ;
116- // Continue with a no-op progress reporter instead of exiting
117- use gittype:: extractor:: NoOpProgressReporter ;
118- let noop_reporter = NoOpProgressReporter ;
119-
120- let mut loader = match RepositoryLoader :: new ( ) {
121- Ok ( loader) => loader,
122- Err ( e) => {
123- eprintln ! ( "Failed to initialize code extractor: {}" , e) ;
124- return Ok ( ( ) ) ;
125- }
126- } ;
127-
128- // Load all code chunks (functions, classes, methods, etc.)
129- let mut available_challenges = loader. load_challenges_from_repository_with_progress ( & repo_path, Some ( options. clone ( ) ) , & noop_reporter) ?;
130-
131- println ! ( "Loaded {} challenges from code chunks" , available_challenges. len( ) ) ;
132-
133- // Generate additional Zen challenges for all source files in the repository
134- println ! ( "Generating Zen challenges from all files..." ) ;
135- let all_file_zen_challenges = loader. load_all_files_as_zen_challenges ( & repo_path) ?;
136- println ! ( "Generated {} Zen challenges from files" , all_file_zen_challenges. len( ) ) ;
137- available_challenges. extend ( all_file_zen_challenges) ;
138-
139- if available_challenges. is_empty ( ) {
140- eprintln ! ( "No code chunks found in the repository" ) ;
141- return Ok ( ( ) ) ;
142- }
143-
144- println ! ( "Total challenges: {}" , available_challenges. len( ) ) ;
145-
146- // Just show the challenge counts for now in WSL environment
147- println ! ( "\n Challenges by difficulty:" ) ;
148- let mut easy_count = 0 ;
149- let mut normal_count = 0 ;
150- let mut hard_count = 0 ;
151- let mut zen_count = 0 ;
152-
153- for challenge in & available_challenges {
154- if let Some ( ref difficulty) = challenge. difficulty_level {
155- match difficulty {
156- gittype:: game:: stage_builder:: DifficultyLevel :: Easy => easy_count += 1 ,
157- gittype:: game:: stage_builder:: DifficultyLevel :: Normal => normal_count += 1 ,
158- gittype:: game:: stage_builder:: DifficultyLevel :: Hard => hard_count += 1 ,
159- gittype:: game:: stage_builder:: DifficultyLevel :: Zen => zen_count += 1 ,
160- }
161- }
162- }
163-
164- println ! ( "Easy: {} challenges" , easy_count) ;
165- println ! ( "Normal: {} challenges" , normal_count) ;
166- println ! ( "Hard: {} challenges" , hard_count) ;
167- println ! ( "Zen: {} challenges" , zen_count) ;
168- println ! ( "Total: {} challenges" , available_challenges. len( ) ) ;
169-
170- // Show first few challenges for debugging
171- println ! ( "\n First few challenges:" ) ;
172- for ( i, challenge) in available_challenges. iter ( ) . take ( 5 ) . enumerate ( ) {
173- let content_preview = challenge. code_content . lines ( ) . take ( 3 ) . collect :: < Vec < _ > > ( ) . join ( " | " ) ;
174- println ! ( "{}. [{}] {} chars: {}" ,
175- i + 1 ,
176- challenge. difficulty_level. as_ref( ) . map( |d| format!( "{:?}" , d) ) . unwrap_or( "None" . to_string( ) ) ,
177- challenge. code_content. len( ) ,
178- if content_preview. len( ) > 80 {
179- format!( "{}..." , & content_preview[ ..80 ] )
180- } else {
181- content_preview
182- }
183- ) ;
184- }
185-
186- println ! ( "\n Note: WSL environment detected. Full game mode may not work properly." ) ;
112+ eprintln ! ( "Failed to initialize loading screen: {}, continuing without it..." , e) ;
187113 return Ok ( ( ) ) ;
188114 }
189115 } ;
116+
117+ loading_screen. show_initial ( ) ?;
190118
191119 let mut loader = match RepositoryLoader :: new ( ) {
192120 Ok ( loader) => loader,
0 commit comments