Add multilingual Agila learning examples and Git practice guide
This commit is contained in:
commit
85f487afb0
79 files changed
+813
No files matched your search
@@ -0,0 +1,9 @@
|
||||
# A reviewed progress component
|
||||
|
||||
Extend the level component with a clearly specified operation of your own. Submit both successful and expected-failure evidence plus a reviewable explanation.
|
||||
|
||||
- Record the allowed inputs and promised result.
|
||||
- Keep assertion checking enabled and record compiler settings.
|
||||
- Test low and high valid inputs and one precondition violation separately.
|
||||
- Demonstrate that a deliberately wrong body is caught, then restore it.
|
||||
- Explain a remaining limitation and identify one next learning step.
|
||||
@@ -0,0 +1,18 @@
|
||||
pragma Assertion_Policy (Check);
|
||||
with Ada.Text_IO;
|
||||
|
||||
procedure Main is
|
||||
subtype Level is Integer range 0 .. 10;
|
||||
function Next_Level (Current : Level) return Level
|
||||
with Pre => Current < Level'Last,
|
||||
Post => Next_Level'Result = Current + 1;
|
||||
|
||||
function Next_Level (Current : Level) return Level is
|
||||
begin
|
||||
return Current + 1;
|
||||
end Next_Level;
|
||||
begin
|
||||
pragma Assert (Next_Level (0) = 1);
|
||||
pragma Assert (Next_Level (9) = 10);
|
||||
Ada.Text_IO.Put_Line ("Two boundary checks passed");
|
||||
end Main;
|
||||
@@ -0,0 +1,8 @@
|
||||
# My explainable study announcement
|
||||
|
||||
Write a short Ada program that announces a study goal and conditionally prints a progress message. Submit the source, your predictions, and actual results for your self-review.
|
||||
|
||||
- Explain with, the declaration, begin/end, :=, and = in your own words.
|
||||
- Show one starting value that prints the conditional message and one that does not.
|
||||
- Record one deliberate syntax mistake and how the compiler helped locate it.
|
||||
- Credit any AI assistance and explain every retained line.
|
||||
@@ -0,0 +1,11 @@
|
||||
with Ada.Text_IO;
|
||||
|
||||
procedure Main is
|
||||
Lessons_Done : Natural := 0;
|
||||
begin
|
||||
Ada.Text_IO.Put_Line ("My first Agila study session");
|
||||
Lessons_Done := Lessons_Done + 1;
|
||||
if Lessons_Done = 1 then
|
||||
Ada.Text_IO.Put_Line ("One lesson completed");
|
||||
end if;
|
||||
end Main;
|
||||
@@ -0,0 +1,9 @@
|
||||
# A reusable study-plan calculation
|
||||
|
||||
Build and test a small lesson-count component. Start with the nested function; optionally extract it into an Ada package in a local multi-file project.
|
||||
|
||||
- State the Total/Done policy without referring to source code.
|
||||
- Check (0,0), (4,0), (4,3), (4,4), and (4,5).
|
||||
- Explain why the subtraction is reached only when Done is below Total.
|
||||
- Keep calculation separate from output.
|
||||
- Include a review note explaining one design choice and one limitation.
|
||||
@@ -0,0 +1,13 @@
|
||||
with Ada.Text_IO;
|
||||
|
||||
procedure Main is
|
||||
function Remaining (Total, Done : Natural) return Natural is
|
||||
begin
|
||||
if Done >= Total then
|
||||
return 0;
|
||||
end if;
|
||||
return Total - Done;
|
||||
end Remaining;
|
||||
begin
|
||||
Ada.Text_IO.Put_Line (Natural'Image (Remaining (4, 1)));
|
||||
end Main;
|
||||
@@ -0,0 +1,9 @@
|
||||
# A score validator with a test table
|
||||
|
||||
Adapt the starter into an explainable score validator with a documented review threshold. Use fixed raw values for repeatable practice before adding interactive input.
|
||||
|
||||
- Document accepted values and the response to invalid values.
|
||||
- Test -1, 0, 1, 99, 100, and 101.
|
||||
- Test the review threshold on both sides and exactly at it.
|
||||
- Explain the membership test, conversion, and any message formatting.
|
||||
- Include actual output and a short self-review note.
|
||||
@@ -0,0 +1,12 @@
|
||||
with Ada.Text_IO;
|
||||
|
||||
procedure Main is
|
||||
subtype Score is Integer range 0 .. 100;
|
||||
Raw : Integer := 101;
|
||||
begin
|
||||
if Raw in Score then
|
||||
Ada.Text_IO.Put_Line ("Accepted" & Score'Image (Score (Raw)));
|
||||
else
|
||||
Ada.Text_IO.Put_Line ("Score must be between 0 and 100");
|
||||
end if;
|
||||
end Main;
|
||||
@@ -0,0 +1,9 @@
|
||||
# A review of an AI-style threshold draft
|
||||
|
||||
Review and repair the deliberately flawed threshold function. Present your reasoning so you can verify it without the conversation that produced the draft.
|
||||
|
||||
- Restate the at-least-70 requirement in your own words.
|
||||
- Trace 69, 70, and 71 before execution.
|
||||
- Show the incorrect and corrected comparisons with actual results.
|
||||
- Explain input type, Boolean result, and the output call.
|
||||
- Record AI assistance and answer one new boundary example you predict and test.
|
||||
@@ -0,0 +1,10 @@
|
||||
with Ada.Text_IO;
|
||||
|
||||
procedure Main is
|
||||
function Passed (Score : Integer) return Boolean is
|
||||
begin
|
||||
return Score > 70; -- Deliberate candidate to review
|
||||
end Passed;
|
||||
begin
|
||||
Ada.Text_IO.Put_Line (Boolean'Image (Passed (70)));
|
||||
end Main;
|
||||
@@ -0,0 +1,9 @@
|
||||
# An Agila Forge review packet
|
||||
|
||||
Take one Ada or Flying V project from these tracks and prepare a focused repository contribution that you can reproduce and test independently.
|
||||
|
||||
- Include a README with problem, prerequisites, exact commands, and limitations.
|
||||
- Submit source and independent normal/boundary/failure evidence.
|
||||
- Review the diff and explain every retained change.
|
||||
- Document AI assistance and verification you performed yourself.
|
||||
- Record automated feedback, revisions, final check results, and a next learning objective.
|
||||
@@ -0,0 +1,19 @@
|
||||
# Review packet
|
||||
|
||||
Problem and intended behavior:
|
||||
|
||||
Tools / compiler / SDK revision:
|
||||
|
||||
Build and run commands:
|
||||
|
||||
Test case | Expected | Actual | Why this case matters
|
||||
|
||||
Design choice and failure policy:
|
||||
|
||||
AI assistance and my verification:
|
||||
|
||||
Known limitations:
|
||||
|
||||
Automated feedback and revisions:
|
||||
|
||||
Next learning objective:
|
||||
@@ -0,0 +1,9 @@
|
||||
# A small bug report with reproducible evidence
|
||||
|
||||
Turn the threshold defect into a concise bug report and repair. Include independent expected results, a regression test, and a clearly stated limit.
|
||||
|
||||
- State a requirement and derive expectations before running.
|
||||
- Show the smallest input that reveals the original mismatch.
|
||||
- Demonstrate that the test fails for the defect and passes after the repair.
|
||||
- Record the assertion policy and compiler command.
|
||||
- Explain one untested requirement and propose the next relevant case.
|
||||
@@ -0,0 +1,14 @@
|
||||
pragma Assertion_Policy (Check);
|
||||
with Ada.Text_IO;
|
||||
|
||||
procedure Main is
|
||||
function Passed (Score : Integer) return Boolean is
|
||||
begin
|
||||
return Score >= 70;
|
||||
end Passed;
|
||||
begin
|
||||
pragma Assert (not Passed (69));
|
||||
pragma Assert (Passed (70));
|
||||
pragma Assert (Passed (71));
|
||||
Ada.Text_IO.Put_Line ("Threshold checks passed");
|
||||
end Main;
|
||||
@@ -0,0 +1,9 @@
|
||||
# An evidence-backed SDK review
|
||||
|
||||
Review a short Flying V draft against the released SDK. Produce a supported prototype and a list of claims that need further documentation.
|
||||
|
||||
- Check a UI field, lifecycle sequence, and graphics-output claim.
|
||||
- Record the exact source paths and SDK revision used.
|
||||
- Classify claims as supported, contradicted, or not established.
|
||||
- Run the supported prototype and compare expected with actual output.
|
||||
- Explain the sandbox boundary and keep future interactions labeled as proposals.
|
||||
@@ -0,0 +1,5 @@
|
||||
import agila
|
||||
|
||||
fn main() {
|
||||
agila.preview(agila.Button{label: 'Begin practice'})
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# A three-step study log
|
||||
|
||||
Write a Flying V program that logs the beginning, goal, and end of a study session using the documented SDK function.
|
||||
|
||||
- Use agila.log and identify its definition in the public SDK.
|
||||
- Predict exact output, including the SDK prefix, before execution.
|
||||
- Explain import, main, the string argument, and statement order.
|
||||
- Record one misspelled-function diagnostic and the repair.
|
||||
- Submit source and output for your self-review with the toolchain version.
|
||||
@@ -0,0 +1,5 @@
|
||||
import agila
|
||||
|
||||
fn main() {
|
||||
agila.log('I can explain this program')
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# A lifecycle lab with expected failures
|
||||
|
||||
Build a small application and a set of isolated lifecycle experiments. Explain which errors the SDK detects and what your application does next.
|
||||
|
||||
- Show a normal create/start/request/stop sequence.
|
||||
- Test empty id and empty name independently.
|
||||
- Test request-before-start and double-start independently.
|
||||
- Explain the difference between an error handler that returns and one that continues.
|
||||
- Record source, output, and the limitations of sandbox capability checks for review.
|
||||
@@ -0,0 +1,15 @@
|
||||
import agila
|
||||
|
||||
fn main() {
|
||||
mut app := agila.new_app('dev.student.study', 'Study Buddy') or {
|
||||
eprintln(err.msg())
|
||||
return
|
||||
}
|
||||
app.start() or {
|
||||
eprintln(err.msg())
|
||||
return
|
||||
}
|
||||
app.request(.ui) or { eprintln(err.msg()) }
|
||||
agila.log('Ready to study')
|
||||
app.stop()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# A beginner study-card description
|
||||
|
||||
Use the supplied widget types to describe a study card. Separate the verified sandbox output from your sketch of future interactive behavior.
|
||||
|
||||
- Compose a Column using Text and Button children.
|
||||
- Predict and check child counts for one, two, and three children.
|
||||
- Preview an individual Text and Button and explain their descriptions.
|
||||
- Choose understandable text and record feedback from a reader.
|
||||
- List intended interactions separately and explain why the current Button does not implement a callback.
|
||||
@@ -0,0 +1,11 @@
|
||||
import agila
|
||||
|
||||
fn main() {
|
||||
view := agila.Column{
|
||||
children: [
|
||||
agila.Text{value: 'Today: understand one function'},
|
||||
agila.Button{label: 'Begin practice'},
|
||||
]
|
||||
}
|
||||
agila.preview(view)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# An explainable Agila study-app prototype
|
||||
|
||||
Prepare a reviewable Flying V prototype using documented lifecycle and UI contracts. Add a separate descriptor-validation experiment; document what the sandbox establishes and what needs a production runtime.
|
||||
|
||||
- Explain all retained APIs with references to the public SDK.
|
||||
- Include one successful lifecycle and one handled failure case.
|
||||
- Include a UI description and accurate expected sandbox output.
|
||||
- Test valid, zero, and negative mesh counts independently.
|
||||
- Publish source, commands, actual results, limitations, and AI-use notes for your self-review; never include credentials.
|
||||
@@ -0,0 +1,12 @@
|
||||
import agila
|
||||
|
||||
fn main() {
|
||||
mesh := agila.MeshDescriptor{
|
||||
vertex_count: 3
|
||||
index_count: 3
|
||||
}
|
||||
agila.submit_mesh(mesh) or {
|
||||
eprintln(err.msg())
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
program HelloAgila;
|
||||
begin
|
||||
writeln('Hello, Agila!');
|
||||
end.
|
||||
@@ -0,0 +1 @@
|
||||
fn main() { println!("Hello, Agila!"); }
|
||||
Reference in new issue
Block a user