aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS-TheRevival/TerminalApplications
diff options
context:
space:
mode:
authorEverythingWindows <[email protected]>2022-11-20 16:43:01 +0700
committerEverythingWindows <[email protected]>2022-11-20 16:43:01 +0700
commit2fa56446be7a049994786931e9145043362e8adb (patch)
treefd715e8afde59181985e3e2c654dfbfeeda27880 /ShiftOS-TheRevival/TerminalApplications
parent5ae42df217ded307bb8e33611d2292ebdb523a18 (diff)
downloadshiftos-therevival-old-2fa56446be7a049994786931e9145043362e8adb.tar.gz
shiftos-therevival-old-2fa56446be7a049994786931e9145043362e8adb.tar.bz2
shiftos-therevival-old-2fa56446be7a049994786931e9145043362e8adb.zip
Guide command, MathQuiz App, ShiftOS About, and more
Diffstat (limited to 'ShiftOS-TheRevival/TerminalApplications')
-rw-r--r--ShiftOS-TheRevival/TerminalApplications/External/MathQuiz/App_MathQuiz.vb58
-rw-r--r--ShiftOS-TheRevival/TerminalApplications/External/TerminalExternalApps.vb7
-rw-r--r--ShiftOS-TheRevival/TerminalApplications/Internal/Com_Guide.vb97
-rw-r--r--ShiftOS-TheRevival/TerminalApplications/Internal/Com_Help.vb15
-rw-r--r--ShiftOS-TheRevival/TerminalApplications/Internal/Com_Manual.vb12
-rw-r--r--ShiftOS-TheRevival/TerminalApplications/Internal/Com_Unzip.vb3
-rw-r--r--ShiftOS-TheRevival/TerminalApplications/Internal/Com_Zip.vb3
7 files changed, 194 insertions, 1 deletions
diff --git a/ShiftOS-TheRevival/TerminalApplications/External/MathQuiz/App_MathQuiz.vb b/ShiftOS-TheRevival/TerminalApplications/External/MathQuiz/App_MathQuiz.vb
new file mode 100644
index 0000000..235664f
--- /dev/null
+++ b/ShiftOS-TheRevival/TerminalApplications/External/MathQuiz/App_MathQuiz.vb
@@ -0,0 +1,58 @@
+Module App_MathQuiz
+ Public MQ_1stNum As Integer
+ Public MQ_2ndNum As Integer
+ Public MQ_Operation As String
+ Public MQ_ShouldResult As Integer
+ Public OperationChooser As Integer
+
+ Public Sub MQ_Start()
+ Console.DefaultPrompt = "> "
+ ResetLine("MathQuiz for ShiftOS")
+ NewLine("Answer basic arithmatical question and you'll get codepoints based on the answer")
+ NewLine(Nothing)
+ MQ_GiveQuestion()
+ Console.CurrentInterpreter = "mathquiz"
+ Console.ShouldChange = True
+ Console_Interpreters()
+ End Sub
+
+ Public Sub MQ_GiveQuestion()
+ Dim RandomNum As New Random
+ MQ_1stNum = RandomNum.Next(1, 10)
+ MQ_2ndNum = RandomNum.Next(1, 10)
+ OperationChooser = RandomNum.Next(1, 5)
+ Select Case OperationChooser
+ Case 1
+ MQ_Operation = " + "
+ MQ_ShouldResult = MQ_1stNum + MQ_2ndNum
+ Case 2
+ While MQ_2ndNum > MQ_1stNum
+ MQ_2ndNum = RandomNum.Next(1, 10)
+ End While
+ MQ_Operation = " - "
+ MQ_ShouldResult = MQ_1stNum - MQ_2ndNum
+ Case 3
+ MQ_Operation = " * "
+ MQ_ShouldResult = MQ_1stNum * MQ_2ndNum
+ Case 4
+ MQ_Operation = " / "
+ MQ_ShouldResult = MQ_1stNum / MQ_2ndNum
+ Case Else
+ MQ_Operation = " + "
+ MQ_ShouldResult = MQ_1stNum + MQ_2ndNum
+ End Select
+ NewLine("What is " & MQ_1stNum & MQ_Operation & MQ_2ndNum & " ?")
+ End Sub
+
+ Public Sub MQ_CheckAnswer()
+ Dim TheAnswer As Integer = command
+ If TheAnswer = MQ_ShouldResult Then
+ NewLine("You got the right answer! You got " & MQ_ShouldResult & " Codepoint(s)")
+ ChangeCP(True, MQ_ShouldResult)
+ MQ_GiveQuestion()
+ Else
+ NewLine("You got the wrong answer! Try again")
+ MQ_GiveQuestion()
+ End If
+ End Sub
+End Module
diff --git a/ShiftOS-TheRevival/TerminalApplications/External/TerminalExternalApps.vb b/ShiftOS-TheRevival/TerminalApplications/External/TerminalExternalApps.vb
index 3148ded..6e8c7bd 100644
--- a/ShiftOS-TheRevival/TerminalApplications/External/TerminalExternalApps.vb
+++ b/ShiftOS-TheRevival/TerminalApplications/External/TerminalExternalApps.vb
@@ -105,6 +105,13 @@ Module TerminalExternalApps
Case Else
BC_Calculate()
End Select
+ Case "mathquiz"
+ Select Case command
+ Case "exit"
+ TerminateApp(Nothing)
+ Case Else
+ MQ_CheckAnswer()
+ End Select
End Select
End Sub
diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Guide.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Guide.vb
new file mode 100644
index 0000000..116ba22
--- /dev/null
+++ b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Guide.vb
@@ -0,0 +1,97 @@
+Module Com_Guide
+ Public Sub Guide()
+ NewLine("The Definitive Guide on ShiftOS")
+ NewLine(Nothing)
+ NewLine("ShiftOS is an experimental operating system set to revolutionize personal computing in a progressive way you can think of")
+ Select Case Strings.ComputerInfo(3)
+ Case 0
+ NewLine("You are now in a command-line interface phase of ShiftOS. You can only do one program/task at one time.")
+ End Select
+ NewLine(Nothing)
+ NewLine("To get a list of features available to purchase of ShiftOS, you can type 'shiftorium list'")
+ NewLine("And you can buy a features on ShiftOS by typing 'shiftorium install ' and then type the codename of the feature")
+ NewLine(Nothing)
+ NewLine("Type 'help' to get a list of all commands available in ShiftOS")
+ If Strings.AvailableFeature(0) = 1 Then
+ NewLine("To get any help for each command in the operating system, you can type 'man' and the name of the feature")
+ NewLine(Nothing)
+ End If
+ If Strings.AvailableFeature(5) = 1 Then
+ NewLine("Time is displayed by seconds since 0:00 format such as 660 seconds since midnight is 0:11")
+ ElseIf Strings.AvailableFeature(5) = 3 Then
+ If Strings.AvailableFeature(6) = 1 Then
+ NewLine("Time is displayed by minutes since 0:00 format such as 69 minutes since midnight is 1:09")
+ ElseIf Strings.AvailableFeature(6) = 3 Then
+ If Strings.AvailableFeature(7) = 1 Then
+ NewLine("Time is displayed by hours since 0:00 format such as 19 hours since midnight is 19:00")
+ ElseIf Strings.AvailableFeature(7) = 3 Then
+ If Strings.AvailableFeature(12) = 1 Then
+ NewLine("Time is displayed by PM and AM format, eg: 9 AM, 4 PM")
+ ElseIf Strings.AvailableFeature(12) = 3 Then
+ If Strings.AvailableFeature(23) = 1 Then
+ NewLine("Time is displayed by HH:MM format, eg: 4:20")
+ End If
+ End If
+ End If
+ End If
+ End If
+ If Strings.AvailableFeature(24) = 1 Then
+ NewLine("Date is displayed in days since first day of the year format, such as 32 days since first day of the year is 1 February")
+ ElseIf Strings.AvailableFeature(24) = 3 Then
+ If Strings.AvailableFeature(25) = 1 Then
+ NewLine("Date is displayed in weeks since first week of the year format, such as 10 weeks since first week of the year is approximately first week of March")
+ ElseIf Strings.AvailableFeature(25) = 3 Then
+ If Strings.AvailableFeature(26) = 1 Then
+ NewLine("Date is displayed in months since first month of the year format, such as 8 months since first month of the year is August")
+ ElseIf Strings.AvailableFeature(26) = 3 Then
+ If Strings.AvailableFeature(27) = 1 Then
+ NewLine("Date is displayed in year format, eg: 2022")
+ ElseIf Strings.AvailableFeature(27) = 3 Then
+ If Strings.AvailableFeature(28) = 1 Then
+ NewLine("Date is displayed in MM/YYYY format, eg: 11/2022")
+ ElseIf Strings.AvailableFeature(28) = 3 Then
+ If Strings.AvailableFeature(29) = 1 Then
+ NewLine("Date is displayed in DD/MM/YYYY format, eg: 20/11/2022")
+ End If
+ End If
+ End If
+ End If
+ End If
+ End If
+ NewLine("This operating system supports ")
+ If Strings.AvailableFeature(10) = 1 Then
+ If Strings.AvailableFeature(13) = 1 Then
+ If Strings.AvailableFeature(14) = 1 Then
+ If Strings.AvailableFeature(15) = 1 Then
+ AddLine("16 colors")
+ Else
+ AddLine("Black, Dark and Light Gray, White, as well as Red, Green, and Blue with their darker/brighter variant")
+ End If
+ Else
+ AddLine("Black, Dark and Light Gray, White, as well as Red, Green, and Blue")
+ End If
+ Else
+ AddLine("only in Black, Dark Gray, Light Gray, and White")
+ End If
+ Else
+ AddLine("only 2 colors, Black and White")
+ End If
+ AddLine(". For more information, you can type 'colors' to get the list of supported colors.")
+ NewLine(Nothing)
+ If Strings.AvailableFeature(19) = 1 Then
+ NewLine("You can change your username by typing 'username ' and the name of your username")
+ End If
+ If Strings.AvailableFeature(20) = 1 Then
+ NewLine("You can change your computer name by typing 'hostname ' and the name of your hostname")
+ End If
+ NewLine(Nothing)
+ NewLine("You can get more codepoints by guessing the correct number with 'guess'")
+ If Strings.AvailableFeature(17) = 1 Then
+ AddLine(", writing a text document in 'textpad'")
+ End If
+ If Strings.AvailableFeature(34) = 1 Then
+ AddLine(", answer basic arithmatical question on 'mathquiz'")
+ End If
+ AddLine(".")
+ End Sub
+End Module
diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Help.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Help.vb
index 67d0d41..020ab7b 100644
--- a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Help.vb
+++ b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Help.vb
@@ -3,6 +3,7 @@
NewLine("ShiftOS Help Manual")
NewLine(Nothing)
NewLine("You can type 'help' to get all available commands and its corresponding action.")
+ NewLine("Type 'guide' to get the rough definitive guide on using ShiftOS")
If Strings.AvailableFeature(0) = 1 Then
NewLine("To get help on each command, you can type 'man [command]'")
NewLine(Nothing)
@@ -52,6 +53,7 @@
NewLine("DIR Displays subdirectories And files In a directory")
End If
NewLine("GUESS Runs 'Guess the Number' application")
+ NewLine("GUIDE Shows the definitive guide on using ShiftOS")
NewLine("HELP Shows all commands available and its corresponding action")
If Strings.AvailableFeature(20) = 1 Then
NewLine("HOSTNAME Sets the name of current hostname/computer name with a new one")
@@ -62,6 +64,9 @@
If Strings.AvailableFeature(0) = 1 Then
NewLine("MAN Shows a command, its corresponding action, and its example usage")
End If
+ If Strings.AvailableFeature(34) = 1 Then
+ NewLine("MATHQUIZ A simple puzzle game to answer simpla arithmatical questions")
+ End If
If Strings.AvailableFeature(16) = 1 Then
NewLine("MKDIR Creating a directory")
End If
@@ -98,6 +103,10 @@
ElseIf Strings.AvailableFeature(7) = 3 Then
If Strings.AvailableFeature(12) = 1 Then
NewLine("TIME Display the current time in the form of PM and AM format")
+ ElseIf Strings.AvailableFeature(12) = 3 Then
+ If Strings.AvailableFeature(23) = 1 Then
+ NewLine("TIME Display the current time in the form of HH:MM")
+ End If
End If
End If
End If
@@ -105,6 +114,12 @@
If Strings.AvailableFeature(20) = 1 Then
NewLine("USERNAME Sets the name of current user with a new one")
End If
+ If Strings.AvailableFeature(33) = 1 Then
+ NewLine("UNZIP Extract any files from a zip file")
+ End If
NewLine("VER Printing current version of ShiftOS TheRevival")
+ If Strings.AvailableFeature(32) = 1 Then
+ NewLine("ZIP Compress selected file/directory into a zip file")
+ End If
End Sub
End Module
diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Manual.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Manual.vb
index 3ba13f5..a4bc2cc 100644
--- a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Manual.vb
+++ b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Manual.vb
@@ -149,10 +149,22 @@
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_username & Environment.NewLine
NormalCommand()
End If
+ Case "unzip"
+ If Strings.AvailableFeature(33) = "1" Then
+ TempUsage = TempUsage & "unzip [FILENAME.ZIP]"
+ Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_unzip & Environment.NewLine
+ NormalCommand()
+ End If
Case "ver"
TempUsage = TempUsage & "ver"
Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_ver & Environment.NewLine
NormalCommand()
+ Case "zip"
+ If Strings.AvailableFeature(32) = "1" Then
+ TempUsage = TempUsage & "zip [CONTENT TYPE] '[FILENAME.ZIP]' '[CONTENT NAME]'"
+ Console.TextBox1.Text = Console.TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_zip & Environment.NewLine
+ NormalCommand()
+ End If
Case Else
NewLine("MAN : Invalid command")
End Select
diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Unzip.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Unzip.vb
index 8dcc8c6..c08bc08 100644
--- a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Unzip.vb
+++ b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Unzip.vb
@@ -28,7 +28,7 @@ Module Com_Unzip
End If
End If
- If UnzipString Like "-h '*.zip'" Then
+ If UnzipString Like "-f '*.zip'" Then
Dim UnzipEXE() As String = UnzipString.Split("''")
NewLine(UnzipEXE(1))
If File.Exists(Console.CurrentDirectory & "\" & UnzipEXE(1)) = True Then
@@ -77,6 +77,7 @@ Module Com_Unzip
' if Overwrite = false, copy the file only if it does not exist
' this is done to avoid an IOException if a file already exists
' this way the other files can be copied anyway...
+ NewLine("Copying " & ChildFile.Name & "...")
If Not File.Exists(Path.Combine(DestDir.FullName, ChildFile.Name)) Then
ChildFile.CopyTo(Path.Combine(DestDir.FullName, ChildFile.Name), False)
End If
diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Zip.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Zip.vb
index b48d2ae..27d55de 100644
--- a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Zip.vb
+++ b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Zip.vb
@@ -3,6 +3,7 @@ Imports System.IO.Compression
Module Com_Zip
Public ZipString As String
+ Public NothingIn As Boolean = True
Public Sub Zip()
ZipString = RawCommand.Substring(4)
@@ -20,6 +21,7 @@ Module Com_Zip
ZipFile.CreateFromDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\SysShiftFS\ZIP" & ZipRandomInt, Console.CurrentDirectory & "\" & ZipEXE(1))
NewLine("Removing temporary place of the file...")
Directory.Delete(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\SysShiftFS\ZIP" & ZipRandomInt, True)
+ NothingIn = False
Else
End If
@@ -29,6 +31,7 @@ Module Com_Zip
If Directory.Exists(Console.CurrentDirectory & "\" & ZipEXE(3)) = True Then
NewLine("Compressing the directory into a zip file...")
ZipFile.CreateFromDirectory(Console.CurrentDirectory & "\" & ZipEXE(3), Console.CurrentDirectory & "\" & ZipEXE(1))
+ NothingIn = False
Else
End If