-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprototype.rb
55 lines (42 loc) · 1.09 KB
/
prototype.rb
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
print "> "
my_hash = {}
puts 'Preload?'
if gets.chomp == 'y'
my_hash = {"CIUCIK"=>{"Walk"=>["Slawosz", "Today", "No"],
"Play"=>["Slawosz", "Tonight", "No"]},
"Basia"=>
{"Massage"=>["Slawosz", "Today", "No!"], "Give wine"=>["Slawosz", "Tonight", "No"]}}
name = 'CIUCIK'
end
while input = gets.chomp
break if input == "END"
if input == "ADD LIST"
print "Name of the list: "
name = gets.chomp
my_hash[name] = {}
print "List #{name} is created.\n"
elsif input == "ADD TASK"
print "Please name the task""\n""> "
task = gets.chomp
my_hash[name][task]
print "Please name a responsible person""\n"">"
person = gets.chomp
print "Give a deadline""\n"">"
deadline = gets.chomp
print "Check if done""\n"">"
status = gets.chomp
my_hash[name][task] = [person, deadline, status]
elsif input == "CURRENT LIST"
print "#{name}"
elsif input == "CHANGE LIST"
print "Name a wanted list: "
name = gets.chomp
my_hash[name][task]
elsif input == "INSPECT"
print my_hash
print "\n"
else
print "Incorrect phrase. Please write again.""\n""> "
end
end
p my_hash