This repository was archived by the owner on Jul 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFDOverflow.rb
More file actions
87 lines (87 loc) · 2.34 KB
/
FDOverflow.rb
File metadata and controls
87 lines (87 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
require './FDOverflowCore.rb'
def FolderOverflow()
puts "How many folder do you want to create?"
begin
foldertobecreated = gets.chomp.to_i
puts "Folder name length:"
folderlen = gets.chomp.to_i
puts "Begin Folder Overflow"
fdOverflowCore = FDOverflowCore.new
fdOverflowCore.FolderOverflower(foldertobecreated,folderlen)
puts "Done, do you want to create more? (Y/N)"
answ = YNAnsw()
if answ == true then
FolderOverflow()
else
Overflow()
end
rescue => exception
puts "Failed to create folder, do you want to try to recreate? (Y/N)"
answ = YNAnsw()
if answ == true then
FolderOverflow()
else
Overflow()
end
end
end
def FileOverflow()
puts "How many file do you want to create?"
begin
filetobecreated = gets.chomp.to_i
puts "File Name Length:"
fileLen = gets.chomp.to_i
puts "File Text Length:"
textLen = gets.chomp.to_i
puts "Begin File Overflow"
fdOverflowCore = FDOverflowCore.new
fdOverflowCore.FileOverflower(filetobecreated, fileLen, textLen)
puts "Done, do you want to create more file? (Y/N)"
answ = YNAnsw()
if answ == true then
FileOverflow()
else
Overflow()
end
rescue => exception
puts "Failed to create file, do you want to try to recreate? (Y/N)"
answ = YNAnsw()
if answ == true then
FileOverflow()
else
Overflow()
end
end
end
def YNAnsw()
yorn = gets.chomp
if yorn.downcase == "y" then
return true
elsif yorn.downcase == "n" then
return false
else
puts "Invalid choice, try again!"
YNAnsw()
end
end
def Overflow()
puts "Choose an option:"
puts "1. FolderOverflow"
puts "2. FileOverflow"
puts "3. Exit"
option = gets.chomp
if (option == "1") then
FolderOverflow()
elsif (option == "2") then
FileOverflow()
elsif (option == "3") then
puts "Goodbye, hope to see you again!"
puts "FDOverflow created by GnXOrg (maintained by teppyboy)"
return 0
else
puts "Invalid choice, try again!"
Overflow()
end
end
puts "Welcome to FDOverflow!"
Overflow()