Skip to content

Commit ff16c09

Browse files
committed
Some changing
1 parent 589c4ff commit ff16c09

10 files changed

+43
-7
lines changed
Binary file not shown.

.vs/APComputerScience-CreateTask-Assignment/v17/DocumentLayout.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"RelativeDocumentMoniker": "APComputerScience-CreateTask-Assignment\\Program.cs",
2525
"ToolTip": "C:\\Users\\Thinc\\source\\repos\\APComputerScience-CreateTask-Assignment\\APComputerScience-CreateTask-Assignment\\Program.cs",
2626
"RelativeToolTip": "APComputerScience-CreateTask-Assignment\\Program.cs",
27-
"ViewState": "AQIAAD8AAAAAAAAAAAAAAAoAAAAmAAAA",
27+
"ViewState": "AQIAAAAAAAAAAAAAAAAAAD8AAAA2AAAA",
2828
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
2929
"WhenOpened": "2024-04-04T12:38:05.332Z",
3030
"EditorCaption": ""

APComputerScience-CreateTask-Assignment/Program.cs

+38-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
namespace Bookdisplayer
22
{
3-
public class Program
3+
public static class Program
44
{
5-
public static void Main(string[] args)
5+
public static void Main()
66
{
77
Console.BackgroundColor = ConsoleColor.DarkMagenta;
88
Console.ForegroundColor = ConsoleColor.White;
@@ -27,14 +27,47 @@ public static void BookGrabber()
2727
Console.WriteLine(foldername.Replace(BookDir + "\\", ""));
2828
}
2929
}
30+
// Stack Overflow - javadch
31+
public static string Capitalize(this string word)
32+
{
33+
return word.Substring(0, 1).ToUpper() + word.Substring(1).ToLower();
34+
}
35+
// Provided by GPT
36+
public static string CapitalizeWithSpaces(this string sentence)
37+
{
38+
string[] words = sentence.Split(' ');
39+
for (int i = 0; i < words.Length; i++)
40+
{
41+
words[i] = words[i].Capitalize();
42+
}
43+
44+
return string.Join(" ", words);
45+
}
3046
public static void PageReader()
3147
{
3248
string BookDir = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), $"Books"));
3349
Console.Write("What Book would you like to read from the above options?: ");
3450
string Book = Console.ReadLine();
51+
Book = CapitalizeWithSpaces(Book);
52+
Console.WriteLine(Book);
3553
if (Directory.Exists(Path.Combine(BookDir, Book)))
3654
{
3755
Console.WriteLine($"Book Selected {Book}");
56+
} else
57+
{
58+
int A = 0;
59+
int B = 0;
60+
while (A==B)
61+
{
62+
Console.Write("That was not a option, Try Again!: ");
63+
Book = Console.ReadLine();
64+
Book = CapitalizeWithSpaces(Book);
65+
if (Directory.Exists(Path.Combine(BookDir, Book)))
66+
{
67+
Console.WriteLine($"Book Selected {Book}");
68+
A++;
69+
}
70+
}
3871
}
3972
List<string> Pages = new List<string>();
4073
for (int i = 0; ; i++)
@@ -69,6 +102,7 @@ public static void PageReader()
69102
{
70103
if (currentPage >= 0 && currentPage <= Pages.Count)
71104
{
105+
Console.Clear();
72106
Console.WriteLine("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
73107
Console.WriteLine($"Book: {Book}\nPage: {string.Join(", ", Pages.ElementAt(currentPage))}");
74108
Console.WriteLine("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
@@ -129,6 +163,7 @@ public static void Functions(string Option, ref int currentPage, ref bool BookFi
129163
else if (Option == "X")
130164
{
131165
BookFinishedForNow = true;
166+
Main();
132167
}
133168
else
134169
{
@@ -166,6 +201,7 @@ public static void Functions(string Option, ref int currentPage, ref bool BookFi
166201
{
167202
BookFinishedForNow = true;
168203
y++;
204+
Main();
169205
}
170206
}
171207
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Harry Potter-Current-Page: 1
1+
Harry Potter-Current-Page: 0
22
Sherlock Holmes-Current-Page: 0
33
The Lord Of The Rings-Current-Page: 0

APComputerScience-CreateTask-Assignment/obj/Release/net8.0/APComputerScience-CreateTask-Assignment.AssemblyInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
[assembly: System.Reflection.AssemblyCompanyAttribute("APComputerScience-CreateTask-Assignment")]
1515
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
1616
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
17-
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3bcda02a910526c14586fe0039074932382d62d4")]
17+
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+589c4ffc07e2818e63ec50aa7eaf14eb363d269b")]
1818
[assembly: System.Reflection.AssemblyProductAttribute("APComputerScience-CreateTask-Assignment")]
1919
[assembly: System.Reflection.AssemblyTitleAttribute("APComputerScience-CreateTask-Assignment")]
2020
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e3ac4b87eed1d4bc9798bb609deeab8fb626f4323a98245ff62a9b0ab0366dc8
1+
0487db8ca4273cde13052a4d32a332f8dd11dfd88953a542fb95aecd4d37d286
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"documents":{"C:\\Users\\Thinc\\source\\repos\\APComputerScience-CreateTask-Assignment\\*":"https://raw.githubusercontent.com/SaxbyMod/APComputerScience-CreateTask-Assignment/3bcda02a910526c14586fe0039074932382d62d4/*"}}
1+
{"documents":{"C:\\Users\\Thinc\\source\\repos\\APComputerScience-CreateTask-Assignment\\*":"https://raw.githubusercontent.com/SaxbyMod/APComputerScience-CreateTask-Assignment/589c4ffc07e2818e63ec50aa7eaf14eb363d269b/*"}}

0 commit comments

Comments
 (0)