Skip to content

Instantly share code, notes, and snippets.

@prateekiiest
Last active January 13, 2020 10:52
Show Gist options
  • Save prateekiiest/d1dfd52749e8668a71f7b86bac289d0a to your computer and use it in GitHub Desktop.
Save prateekiiest/d1dfd52749e8668a71f7b86bac289d0a to your computer and use it in GitHub Desktop.

Every leaf in the conversation section of a segregated JSON data store will have a GOTO keyword. Either it will go for next section or exitapp

# present node

update_Progress_at_Each_Step(node)

      totalQuestions(node) = max(DFS_Find_Distance(node,`GOTO`))
      node.step_no += 1
      current_Progress = node.step_no

      progress_val = current_Progress/totalQuestions(node)
      
      show_progress(progress_val) # show progress on the front end
      
----------------------------
      
root.step_no = 0

conversation_flow(root)
  update_Progress_at_Each_Step(root)
  conversation_flow(next_node) # next_node decided based upon user choice, technical details ignored here
  
  


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment