如何构建实现DFA的JAVA或C#程序 [英] How do I build a JAVA or C# program which implements a DFA
问题描述
我需要构建一个实现DFA的JAVA或c#程序
我的DFA将接受我选择的密码。
我的密码长度至少为8个字符;
必须有一个字符组合(小)和大写),数字和特殊字符。
例如:我的密码可以描述如下
1-必须至少8个字符
2-必须以特殊符号@
$ b $开头b
3-必须以大写字母结尾
4必须至少有2位数
我尝试了什么:
尝试创建二维数组以将行填充为接受字符的数量,如@,数字..等和列的状态数
i need to build a JAVA or c# program which implements a DFA
my DFA shall accept a password of my choice.
my password shall be at least 8 characters long;
It must have a combination of characters (small and capital), digits, and special characters.
For example: my password can be described as follows
1- must be at least 8 characters
2- Must begin wiht the special symbol @
3- Must end with a capital letter
4 Must have at least 2 digits
What I have tried:
tried to create two dimensional array to fill the row as number of accepted character like @,digit.. etc and the column as the number of state
推荐答案
研究理论,并不难。一个起点可以是DFA维基百科
页面:确定性有限自动机 - 维基百科,免费百科全书 [ ^ ]。
我会开始构建一个满足其中一个要求的非常基本的自动机。然后,逐步增加它以便最终遵守所有其他的应该是相对简单的。
Study the theory, it is not difficult. A starting point could theDFA Wikipedia
page: "Deterministic finite automaton - Wikipedia, the free encyclopedia"[^].
I would start building a very basic automaton satisfying just one of the requirements. Then it should be reletively simple to progressively augment it in order to eventually comply to all the other ones.
这篇关于如何构建实现DFA的JAVA或C#程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!