Skip to content

Commit

Permalink
Add Apple-1 30th demo
Browse files Browse the repository at this point in the history
  • Loading branch information
sblendorio committed May 22, 2023
1 parent 2bac71a commit 1837c64
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 9 deletions.
Empty file modified mvnw
100644 → 100755
Empty file.
40 changes: 32 additions & 8 deletions src/main/java/eu/sblendorio/bbs/tenants/ascii/MenuApple1.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@
import eu.sblendorio.bbs.core.BbsThread;
import static eu.sblendorio.bbs.core.Utils.STR_ALPHANUMERIC;
import static eu.sblendorio.bbs.core.Utils.setOfChars;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.stream.Collectors.toList;
import static org.apache.commons.lang3.StringUtils.startsWith;
import static org.apache.commons.lang3.math.NumberUtils.toInt;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Path;
import java.util.*;

import eu.sblendorio.bbs.core.Utils;
import org.apache.commons.lang3.StringUtils;

public class MenuApple1 extends AsciiThread {
Expand Down Expand Up @@ -152,6 +156,7 @@ public void doLoop() throws Exception {
else if ("w".equals(choice) && !alternateLogo()) subThread = new ChatGptAscii();
else if ("x".equals(choice) && !alternateLogo()) { showPatrons(); subThread = null; }
else if ("y".equals(choice) && !alternateLogo()) { wifiModem(); subThread = null; }
else if ("z".equals(choice) && !alternateLogo()) { apple1Demo(); subThread = null; }
else {
validKey = false;
subThread = null;
Expand Down Expand Up @@ -190,14 +195,14 @@ public void displayMenu() {
println("E - The 8-Bit Guy "+ sp +" R - Zork III");
println(" "+ sp +" S - Hitchhiker's");
println("Italian News");
println("----------------- "+ sp +" Services");
println("F - Televideo RAI "+ sp +" ---------------");
println("G - Lercio "+ sp +" T - Chat");
println("H - Disinformatico "+ sp +" U - Private Msg");
println("I - Mupin.it "+ sp +" V - Eliza");
println("J - Fatto Quotidiano "+ sp + (alternateLogo() ? "" : " W - Chat GPT"));
println("K - Amedeo Valoroso "+ sp + (alternateLogo() ? "" : " X - Patrons list"));
println("L - Butac.it "+ sp + (alternateLogo() ? "" : " Y - Wifi Modem"));
println("----------------- "+ sp +" Services-------");
println("F - Televideo RAI "+ sp +" T - Chat");
println("G - Lercio "+ sp +" U - Private Msg");
println("H - Disinformatico "+ sp +" V - Eliza");
println("I - Mupin.it "+ sp + (alternateLogo() ? "" : " W - Chat GPT"));
println("J - Fatto Quotidiano "+ sp + (alternateLogo() ? "" : " X - Patrons list"));
println("K - Amedeo Valoroso "+ sp + (alternateLogo() ? "" : " Y - Wifi Modem"));
println("L - Butac.it "+ sp +" Z - Apple-1 Demo");
println("M - Alessandro Albano"+ sp +" . - Logout");
println();
}
Expand Down Expand Up @@ -230,6 +235,24 @@ public void showPatrons() throws Exception {
flush(); resetInput(); readKey();
}

public void apple1Demo() throws Exception {
List<Path> drawings = Utils.getDirContent("apple1/demo30th");
for (Path drawing : drawings) {
String filename = drawing.toString();
if (startsWith(filename,"/")) filename = filename.substring(1);
final String content = new String(readBinaryFile(filename), UTF_8);
cls();
for (String row: content.split("\n")) {
println();
print(row);
}
flush(); resetInput();
int ch = keyPressed(60_000);
if (ch == '.') return;
}
}


public void wifiModem() throws Exception {
cls();
banner();
Expand Down Expand Up @@ -264,4 +287,5 @@ private List<String> readTxt(String filename) {
return result;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void initBbs() throws Exception {

@Override
public void doLoop() throws Exception {
if (alternateLogo()) { println();println();println("Moved to BBS.RETROCAMPUS.COM");println(); keyPressed(10_000); return; }
if (alternateLogo()) { println();println();println("moved to bbs.retrocampus.com");println(); keyPressed(10_000); return; }
int ch;
String banner = (alternateLogo() ? "RETROACADEMY" : "RETROCAMPUS") + " BBS";
write(12);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1837c64

Please sign in to comment.