aboutsummaryrefslogtreecommitdiff
path: root/automata_flotantes.py
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-11-15 08:08:06 -0600
committerIván Ávalos <avalos@disroot.org>2022-11-15 08:08:06 -0600
commitc78465010691d45f5e5bfa6a36a96800d30962ac (patch)
tree93521b0c9788712823937e4c48212bc02f0b04b5 /automata_flotantes.py
parenta3097d32c66cbdff04de14481923c7464b0a8a29 (diff)
downloadjavanol-c78465010691d45f5e5bfa6a36a96800d30962ac.tar.gz
javanol-c78465010691d45f5e5bfa6a36a96800d30962ac.tar.bz2
javanol-c78465010691d45f5e5bfa6a36a96800d30962ac.zip
Se elimina código de interfaz y se reorganizan directorios
Diffstat (limited to 'automata_flotantes.py')
-rw-r--r--automata_flotantes.py78
1 files changed, 0 insertions, 78 deletions
diff --git a/automata_flotantes.py b/automata_flotantes.py
deleted file mode 100644
index 5ba2b7d..0000000
--- a/automata_flotantes.py
+++ /dev/null
@@ -1,78 +0,0 @@
-class automata_flot:
- stateN = 0
- def isAccepted(self, _str):
- i = len(_str)
- _len = len(_str)
-
- for i in range(len):
- if self.stateN == 0:
- self.start(_str[i])
- if self.stateN == 1:
- self.state1(_str[i])
- if self.stateN == 2:
- self.state2(_str[i])
- if self.stateN == 3:
- self.state3(_str[i])
- if self.stateN == 4:
- self.state4(_str[i])
- if self.stateN == 5:
- self.state5(_str[i])
- else:
- return 0
-
- if self.stateN == 5:
- return 1
- else:
- return 0
-
- def start(self, c):
- if (c == '0'):
- self.stateN = 1
- else if(c == '-'):
- self.stateN = 2
- else if(c == '1' or c == '2' or c == '3' or c == '4' or c == '5' or
- c == '6' or c == '7' or c == '8' or c == '9'):
- self.stateN = 3
- else:
- self.stateN = -1
-
- def state1(self,c):
- if (c == '.'):
- self.stateN = 4
- else:
- self.stateN = -1
-
- def state2(self,c):
- if(c == '0'):
- self.stateN = 1
- else if(c == '1' or c == '2' or c == '3' or c == '4' or c == '5' or
- c == '6' or c == '7' or c == '8' or c == '9'):
- self.stateN = 3
- else:
- self.stateN = -1
-
- def state3(self,c):
- if(c == '.'):
- self.stateN = 4
- else if c.isdigit():
- stateN = 3
- else:
- self.stateN = -1
-
- def state4(self,c):
- if c.isdigit():
- self.stateN = 5
- else:
- self.stateN = -1
-
- def state5(self,c):
- if c.isdigit():
- self.stateN = 5
- else:
- self.stateN = -1
-
- def verified(self,token):
- if isAccepted(token)
- return true
- else:
- return false \ No newline at end of file