-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package main | ||
import ("fmt") | ||
|
||
func MainMenu() int { | ||
for true { | ||
|
||
fmt.Println("1. View All Task") | ||
fmt.Println("2. Add Task") | ||
fmt.Println("3. Delete Task") | ||
var selected_option int = -1 | ||
fmt.Print("Option: ") | ||
fmt.Scan(&selected_option) | ||
if (selected_option != -1 && selected_option > 0 && selected_option < 4) { | ||
return selected_option | ||
} | ||
} | ||
return -1 | ||
} | ||
|
||
var tasks = [] string {} | ||
var tasks_status = [] bool {} | ||
|
||
func showAllTasks() { | ||
fmt.Println("Available Tasks are:") | ||
for i := 1; i <= len(tasks); i++ { | ||
if tasks_status[i] == true { | ||
fmt.Printf("%d. %s[Comp1leted]", i, key) | ||
} else { | ||
fmt.Printf("%d. %s[Not Completed]", i, key) | ||
} | ||
i++ | ||
} | ||
} | ||
|
||
func addTasks() { | ||
|
||
} | ||
|
||
func main() { | ||
fmt.Println("A GoLang Based To Do App------") | ||
selected_option := MainMenu() | ||
fmt.Println(selected_option) | ||
if selected_option == 1 { | ||
showAllTasks() | ||
} else if selected_option == 2 { | ||
addTasks() | ||
} else if selected_option == 3 { | ||
// delete task | ||
} | ||
} |