Add SIN.04028 tutorial material, tutor prompt and conversation log
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
String rot13(String text) {
|
||||
var result = new StringBuilder();
|
||||
|
||||
for (var character : text.toCharArray()) {
|
||||
if (character >= 'a' && character <= 'z')
|
||||
character = (char) ('a' + (character - 'a' + 13) % 26);
|
||||
else if (character >= 'A' && character <= 'Z')
|
||||
character = (char) ('A' + (character - 'A' + 13) % 26);
|
||||
|
||||
result.append(character);
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
void main() throws Exception {
|
||||
FileMessageBoard.watch("rot13/inbox", message -> {
|
||||
if (!message.type().equals("TEXT"))
|
||||
return;
|
||||
|
||||
try {
|
||||
FileMessageBoard.publish(
|
||||
"rot13/outbox",
|
||||
new Message("TEXT", rot13(message.value()))
|
||||
);
|
||||
} catch (IOException exception) {
|
||||
throw new UncheckedIOException(exception);
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user