Search results for query: *

  1. M

    Question Is it possible to test whether the key pressed can generate a character?

    Thank you, that does almost exactly what I need :). The reason that MSDN isn't my first port of call is simply because it's not a good reference guide. You have to know exactly what you're looking for, and even when you do it's often not written in an intuitive way.
  2. M

    Question Is it possible to test whether the key pressed can generate a character?

    I'm trying to make a class that produces a facsimile of the textbox from Winforms in Console. I have a loop within this class that is reading keypresses as ConsoleKeyInfo. What I want to do is to take a keypress and test whether it corresponds to an actual character. For example, the A key...
  3. M

    Generating tones of different frequencies and running batch commands

    The others have mostly said it all, it's just Console.Beep([Frequency/Pitch],[Duration]) with the first value in Hertz and the second in Milliseconds. Also, this article might be useful to you: Piano key frequencies - Wikipedia, the free encyclopedia This tells you all the frequencies for keys...
  4. M

    Question <- (Yet another) -- How do I run multiple functions at once in Console?

    Hey guys... sorry to keep bugging you, but you really are wonderfully helpful when it comes to VB, and I could much use your input again! Our Computing teacher is encouraging us to try making games with Console in VB, and I like the idea, but there's one big problem with a lot of games that I...
  5. M

    Question How to add more values to a 2D array

    Hey guys - I found a solution, but it was sort of cheating, really. In any case, it works and I'm happy with it. Instead of creating a new value in the existing array, I used a second array with the same number of values as the first, that stored colour information for each pixel. It wrote the...
  6. M

    Question How to add more values to a 2D array

    Hey again! I know I keep asking questions but you guys are so wonderful and I need some help ^^'. I'm trying to make a program where you can move around a cursor on a 15x20 grid (the size can change dynamically,) and place coloured blocks (█) in any way you like to make a basic ASCII picture. I...
  7. M

    Question How to use multidimensional arrays

    Further revisions! It should look like this: Sub PlaceObjectElements() 'Places player, key and blocks. For i = 0 To BlockCoords.GetLength(0) - 1 PlayGrid(BlockCoords(i, 0), BlockCoords(i, 1)) = BlockCursor Next PlayGrid(KeyCoord(0), KeyCoord(1)) = KeyCursor...
  8. M

    Question How to use multidimensional arrays

    Wait, never mind! I've figured out how to do it after all. The declarations: Dim PlayerCoord() As Integer = {7, 4} 'Player Coordinate, read DOWN and then ACROSS. Dim BlockCoords(,) As Integer = {{7, 3}, {1, 4}, {3, 4}} 'Block Coordinates, each pair of braces is a new block. Dim...
  9. M

    Question How to use multidimensional arrays

    Hey again guys! I've been working on an Ice Puzzle: you're a character (e.g. '*') in a grid (2D array) and you can move using the arrow keys - when you move, you keep going in that direction until you hit a surface. The aim is to pick up a key, which progresses you to the next level. There are...
  10. M

    Question How to iterate through a List randomly and in order

    Ian - Thank you! Yes, it does a lot :). And please, crit away ^_^.
  11. M

    Question How to iterate through a List randomly and in order

    Hey guys, So I worked on this a bit and with mostly jmcil's advice I managed to get a Lottery program to work :). Took me long enough, but hey! It doesn't do it quite the way I originally planned it, but it still works and it's good enough for me. Thanks all! Module LotteryNumbers Dim...
  12. M

    Question What am I doing wrong? - Logic error

    Hey guys - I came across a programming problem that I wanted to solve, and I've almost got a program working that does what I want it to do, but not quite. What I want to do is to create a digital river - this is where you add up every digit within a number, and then add that result to the...
  13. M

    Question How to iterate through a List randomly and in order

    Hey guys, sorry I haven't been as active in this topic or letting you know how I was getting along - I admit I got bored of the number-list problem before I could really develop a program out of it. I have another issue though, which I'll post in a new thread.
  14. M

    Question How to iterate through a List randomly and in order

    Hey Ian: I'm using the Console, not a GUI, but hopefully this should work the same!
  15. M

    Question How to iterate through a List randomly and in order

    Thank you both! Though jmcil, I don't know how to use Count, and I can use a For loop but I don't know how to get it to iterate the way you specify :c.
  16. M

    Question How to iterate through a List randomly and in order

    Hey there! I started VB just over a month ago, we've been working with console applications - no GUI - and I've been having great fun with it. Recently - with every bit of help from wonderful forumers - I experimented using Lists to create a Periodic Table quiz, and now I had some more...
  17. M

    Question Get user-input variables to match set values (no matter the order they are entered)

    Thank you, the .tolower() in the With tag worked beautifully! But the Dim elements is already at the start of the loop - it works just fine. The list is repopulated after the program loops :).
  18. M

    Question Get user-input variables to match set values (no matter the order they are entered)

    Indeed so! Yeah, I have these problems most frequently with things like pressing enter where you're supposed to type a value in first, or pressing the wrong key. I'm gradually learning to avoid these - if I ever have an If statement I try to make sure it accounts for the possibility that you...
  19. M

    Question Get user-input variables to match set values (no matter the order they are entered)

    Hey, I've been having another problem. I've created the subroutine for wrong answers as you showed me: Private Sub Displaywronganswers(Wronganswerlist As List(Of String)) Console.WriteLine("The following answers were incorrect:") For Each item As String In Wronganswerlist...
Back
Top