当索引值是整数数组时,如何获取索引值。 [英] How Do I Get The Index Value When The Index value Is An Array Of Integer.

查看:142
本文介绍了当索引值是整数数组时,如何获取索引值。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究bbid密码解码器/黑客的vb.net版本。



我发现了一些代码可以创建5x5矩阵字母 - 字母J.

我从C#版转换而来。



I'm working on a vb.net version of the bifid cipher decoder/cracker.

I found some code that will create the 5x5 matrix out of the alphabet - the letter J.
That I converted from a C# version.

Private KeyMatrix As String(,) = New String(4, 4) {}




Private Sub BuildKeyMatrix()
    Dim k As Integer = 65
    For i As Integer = 0 To 4
        For j As Integer = 0 To 4 'index has to start at zero or errors out
            If k = 74 Then
                k += 1
            End If
            ' j’yi alma(j take) (j ascii = 64)
            KeyMatrix(i, j) = Chr(k).ToString()
            k += 1
        Next
    Next
End Sub





通过调试器查看时,您会看到它显示索引/值对为



0,0 A

0,1 B

0,2 C

0,3 D

0,4 E

1,0 F

$ G

1, 2 H

等等



如果我这样做,我可以收到这些信件。





When viewed thru the debugger you see it is showing index / value pair as

0,0 A
0,1 B
0,2 C
0,3 D
0,4 E
1,0 F
1,1 G
1,2 H
and so on

If I do this I can get the letters.

For Each ltr In KeyMatrix
    strbldr.AppendLine(ltr)
Next



但是如何按字母值返回索引数组?

标准索引(of)对数组的索引不起作用。



我可能只使用两个基于零的索引或列表(类型)一个Char和另一个整数数组。


But how do I get the Index array back by letter value ?
A standard Index(of ) does not work for indexs of array.

I may just use two Zero based indexes or list(of type) one of Char and another of the Integer array.

推荐答案

在研究之后,答案是不使用这种方法来创建矩阵。

没有内置的方法可以在不创建你的情况下退出点数自己的功能。



更简单的方法是他们在这里完成的方式

http://practicalcryptography.com/ciphers/classical-era/bifid/ [ ^ ]



只需查看查看函数的页面源。



它们基本上创建了两个整数列表,用于处理5x5矩阵中的x,y位置。
After looking into this more the answer is to not use this method to create the matrix.
There is no built in way to get the "Points" back out without creating your own function.

The easier way is the way they done it here
http://practicalcryptography.com/ciphers/classical-era/bifid/[^]

Just view the source of the page to see the functions.

They are basicly creating two list of integer to work with the x,y locations in the 5x5 matrix.


这篇关于当索引值是整数数组时,如何获取索引值。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆