Send me a gwei! (ether address, all donations accepted!) 0xfFB33D2Af25909eB92dF5Da6236b69c4AFBaC692 send me a satoshi! (bitcoin address, all donations accepted!) 0xfFB33D2Af25909eB92dF5Da6236b69c4AFBaC692
Current Channel Goal: 25,000 Subs!
Hey folks, TechNeverSeer just doing some random coding here.
I've been playing around with some stuff and
having some issues with it, but I think I figured out what I've been doing wrong.
Let's see, throw an exception, isn't it? Yeah, all right.
So, I think we need to get rid of that whole recursive bit.
In fact, let's do it like so.
All right, and this is exactly why I do this,
because this is something that is so simple and I end up getting rusty.
For measure l, I've got intents plus equals key.
None of this is going to make sense to you because I haven't explained any of these variables,
but I'm just trying to get my head around things.
Okay, so if alpha contains, which it will,
all the plus equals, that's not going to work.
Okay, so basically I'm going to go through each character of the string
and I'm going to compare it to two different arrays.
I haven't tried that yet.
Okay, so if, do a nested for loop for int f, why not, equals zero,
f is less than 26, f plus plus.
All right, so now we're going to try it this way.
So, I have one too many of these, whoops.
Okay, so now, ah, ****, I lost it.
For measure l equals zero, l equals for each character in the string,
alpha f.
Okay, so this means it's found a matching character.
So, at this point, say holder plus plus key f, right?
Okay, so instead of trying to be recursive, that was my plus plus equals, not plus plus.
It should allow me to add a character.
Okay, I need to do one other thing.
Space, 27, I need to make sure I made that.
Key only needs to be 26, so I'm going to leave 27 there.
Number 27, characters, key string.
Okay, so set key, key string is zero for integer, plus the key dot length.
Okay, so this is removing them.
That should do that.
All right, so let's see if what we changed up here is going to do any good for us with
our program here, because I haven't been having any luck.
And like I said, I do this just to keep from getting rusty, but obviously it's not working,
and I'm getting rusty.
So, I need to do it more.
Don't find the time to code too many WinForm applications these days with all of that.
I'm not getting any errors.
This is taking forever to load.
Today would be nice.
Of course, suspicious file detected.
I did throw an exception, so we'll hit cancel.
I bet it's an index out of bounds.
I need a new computer so bad, guys.
This is ridiculous.
Hear my son in the background?
Obviously he doesn't want to go to sleep.
I can hear him on the monitor.
Dah, dah, dah, dah, dah.
I know, buddy.
But it's bedtime.
Ah, and that is a stupid exception.
Look at that.
I have 256 instead of 26, so continue.
See if it'll run now.
No, index was at a range.
Okay, oh.
Length.
It's going to have to do length minus one there.
All right, and we are up.
As you can see, here's our encryption key that it's picking from the possible list.
And let's put in a string.
Encrypt.
This is what we get.
Let's see if it lines up.
E.
I should just put the alphabet right next to it so I can see.
Yeah, that'd be about right.
Okay, so our spaces are coming out properly.
And everything seems to be working right.
So the idea here is we're going to use this algorithm to make a game.
Basically, we'll be able to change the letters.
When we change one, it's going to have to change our options without changing our key
or our regular alphabet.
So if it's correct, it'll lock it in.
And if not, it won't.
Let's move on to the next step.
And close that.
Stop that.
I need to go to our win form here.
And okay, next step will be to add a game board.
So let's go to toolbox, grab a panel, drag that in.
I'm going to move that right up here.
We'll adjust this later.
But for now, we'll leave it right like that.
So let's take this panel.
Properties.
Make sure it's not displaying properly.
All right, we're having issues here.
Close that.
Just stop.
There we go.
All right, it wasn't showing me my properties.
But I got it now.
All right, so this panel is...
Don't need anything in there just yet.
But we are going to add a new form.
It's going to be a pretty simple form.
This one is going to be letter.
All right, so let's be top level.
Let's see here.
So we did get this working.
Now I have a formatting issue.
That should help, actually.
Let's reduce the text size, though.
22 should be okay.
Fit all my letters.
Okay, so let's start this again.
So it's too big for my panel.
Obviously, I'm going to have to do some sort of spacing.
And I want things to be broken up on spaces and not just random lines.
So that's going to take a little bit of work.
So here we go.
I'm still getting a lot of space in between.
And I'm not picking up the crypt.
Okay, so form one.
I'm going to take all of this.
Move it down here for debugging purposes.
I'm going to take this.
Spread it to here.
And my other son's talking to himself.
You're going to get to meet all the kids in this video.
So all right, we've knocked into my Coke can.
Not that this is all such a lovely view here, right?
I mean, this is epic use of negative space.
Anyway, am I looking at the control here?
And the cat's got to chime in.
Perfect.
All right, so I need to grab...
All right, as usual, this is not working out for me.
I'm going to call this video right here.
And we'll see in the next one.
I'm going to keep playing around with this.
You should see more of it and what it is and what it does down the road.
But for now, sayonara.