feat: add Console.readLine and Console.readInt, guessing game project
Add readLine and readInt operations to the Console effect for interactive input. Create a number guessing game project demonstrating ADTs, pattern matching, effects, and game state management. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
10
src/types.rs
10
src/types.rs
@@ -780,6 +780,16 @@ impl TypeEnv {
|
||||
params: Vec::new(),
|
||||
return_type: Type::String,
|
||||
},
|
||||
EffectOpDef {
|
||||
name: "readLine".to_string(),
|
||||
params: Vec::new(),
|
||||
return_type: Type::String,
|
||||
},
|
||||
EffectOpDef {
|
||||
name: "readInt".to_string(),
|
||||
params: Vec::new(),
|
||||
return_type: Type::Int,
|
||||
},
|
||||
],
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user