我正在尝试制作diceware生成器。需要一些帮助。 [英] I'm trying to make diceware generator. Need some help.
问题描述
嗯,该程序功能齐全,但我需要帮助的东西很少。
Well, the program is fully functional but there are few things that I need help with.
首先:
      Dim myRand1As Integer
Dim myRand1As Integer
      myRand1 = generator.Next(11111,66666)
myRand1 = generator.Next(11111, 66666)
此代码应模拟骰子投掷5次。但在这个随机数发生器中,我得到0,7,8和9个数字,这些数字不适用于diceware设计。
This code should simulate the dice throw 5 times. But in this randomizer, I get 0,7,8 and 9 numbers which are not usable with diceware design.
第二:
我需要以某种方式连接到我的网站的SQL,我可以使用与论坛注册的数据库中的相同登录。
I need somehow make a connection to my website's SQL that I can use same logins from the database that is registered with a forum.
推荐答案
嗯,该程序功能齐全但我需要的东西很少帮助。
Well, the program is fully functional but there are few things that I need help with.
首先:
    Dim myRand1As Integer
Dim myRand1As Integer
      myRand1 = generator.Next(11111,66666)
myRand1 = generator.Next(11111, 66666)
此代码应模拟骰子投掷5次。但在这个随机数发生器中,我得到0,7,8和9个数字,这些数字不适用于diceware设计。
This code should simulate the dice throw 5 times. But in this randomizer, I get 0,7,8 and 9 numbers which are not usable with diceware design.
第二:
我需要以某种方式连接到我的网站的SQL,我可以使用与论坛注册的数据库中的相同登录。
I need somehow make a connection to my website's SQL that I can use same logins from the database that is registered with a forum.
您好
这两行代码绝对没有任何意义!
Those two lines of code mean absolutely nothing!
"生成器"在某处被定义为"新随机"吗?
Is 'Generator' defined as a 'New Random' somewhere?
您似乎想要在11111和 之间分配一个数字。 66666到' myRand1 ' - 这与" 0,7,8 和
9 "的结果有什么关系?
You seem to want to assign a number between 11111 and 66666 to 'myRand1' - how does that relate to results of '0,7,8 and 9'?
这是一个片段,显示如何创建1到6之间的100个随机数列表。
Here is a snippet showing how to create a list of 100 random numbers between 1 and 6 inclusive.
Option Strict On
Option Explicit On
Public Class Form1
Dim Generator As New Random
Dim lst As New List(Of Integer)
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' create 100 random numbers between 1 and 6 inclusive
For i As Integer = 1 To 100
lst.Add(Generator.Next(1, 7))
Next
End Sub
End Class
BTW:为第二个问题开始一个新线程。
BTW: start a new thread for a second question.
这篇关于我正在尝试制作diceware生成器。需要一些帮助。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!