Code Monkey home page Code Monkey logo

validwebaddresses's Introduction

LinkAutomata

DFA Diagram

image

In the above DFA, q0 is the starting state whereas, q10 and q12 are the final states

Program Specs:

Program first asks user to input ‘y’ or ‘n’ as a yes or no. If the user enters a valid input then program asks the user to input a string. After the string is entered program checks step-by-step each state of the DFA. If any change of the state occurs, program changes itself accordingly. It outputs the character with its current state at each iteration. If at any iteration, the input goes on a trap state, then it will remain there till the rest of the string iteration is completed. There are separate functions to check the states and to change the state accordingly. After an input is completed, the program then prints Accepted or Rejected based on the string evaluation. The string is only considered accepted if it terminates on either q10 or q12. In the rest of the all cases, the string is rejected. The program has handled almost every case that I have given to it. For mine test case the program is working effectively.

Some of the string that I have tested:

  1. ww.com (accept)
  2. www.com (accept)
  3. wwww.com (accept)
  4. 1.com (trap - reject)
  5. 2.com (trap - reject)
  6. www.google.com (accept)
  7. www.lhr.nu (trap – reject)
  8. www.google (reject)
  9. www.lhr.nu.edu.pk (trap-reject)
  10. .com (trap-reject)
  11. .pk (trap – reject)
  12. lhr.com (accept) These are just some of the strings, however, I have tested many.

validwebaddresses's People

Contributors

harisali-git avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.