class ToDoList

    def initialize
        @pendingTasks = []
        @accomplishedTasks = []
    end

    def add_task(task_name)
        @pendingTasks.push(task_name)
        puts "#{task_name} has been added to your task list"
    end

    def view_pending_tasks
        puts 'Pending tasks:'
        @pendingTasks.each do |task|
            i = @pendingTasks.index(task)
            i += 1
            puts "(#{i}) #{task}"
        end
    end

    def accomplish_task(index)
        temp = @pendingTasks[index]
        @pendingTasks.delete_at(index)
        @accomplishedTasks.push(temp)
        puts "#{temp} has been marked as accomplished"
    end

    def view_accomplished_tasks
        puts 'Accomplished tasks:'
        @accomplishedTasks.each do |task|
            i = @accomplishedTasks.index(task)
            i += 1
            puts "(#{i}) #{task}"
        end
    end

end