Author Topic: Dice Roller 2 - My First InForm Tool  (Read 8059 times)

0 Members and 1 Guest are viewing this topic.

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Dice Roller 2 - My First InForm Tool
« on: November 15, 2019, 12:07:15 am »
This might have been made already on InForm but since a very similar dice roller was made by me many months ago when I began QB64, I decided to try my hand at an InForm version. The old one is also on my website but will probably be replaced by this one very soon. Making it was really fun. It seemed a little bit harder than I thought, but once I knew what I was doing it's really simple. As I'm sure you all will find it will be simple too. Here is a picture of it and the .zip file. It has 2 giant buttons and when you press one it randomly chooses between 1 to 6 and puts the total of both in the textbox above. This is the first time I've used textbox with InForm by the way. I realize this is very beginner basic stuff and probably Day 1 in a programming class, but that's me with InForm for now. :)

(Note: There is a much better version on a post below that lets people choose how many sides the dice have.)






DiceRoller2.jpg
* DiceRoller2.jpg (Filesize: 17.79 KB, Dimensions: 310x226, Views: 704)
* DiceRoller2.zip (Filesize: 84.18 KB, Downloads: 462)
« Last Edit: November 15, 2019, 07:19:33 pm by SierraKen »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Dice Roller 2 - My First InForm Tool
« Reply #1 on: November 15, 2019, 01:09:00 am »
What's nice is that these dice can do any numbers, you can preset before rolling for a game that needs other numbers besides 1 through 6, you could add letters or colors or...

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Dice Roller 2 - My First InForm Tool
« Reply #2 on: November 15, 2019, 03:00:41 pm »
Wow great idea, thanks! I'll try to do that real soon.

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Dice Roller 2 - My First InForm Tool
« Reply #3 on: November 15, 2019, 05:35:07 pm »
OK, took me a couple hours but I did it! I let the user enter any amount from 3 to 100, which is just about any dice I believe, on both dice. If you enter more it brings it down to 100 and less it brings it up to 3. It starts out as 6 for both of them as well as when you click Reset. I learned a lot about strings and variables using textbox and also using numeraltextbox which is only for numbers. I kept the Total as a text box though because I like how it states "Total" before you do anything inside the box. This can be used for any game that uses dice. If you are missing dice, just use this instead. This is the best program I've ever made that uses Windows Forms. :) I'm learning!

DiceRoller2-b.jpg
* DiceRoller2-b.jpg (Filesize: 32.31 KB, Dimensions: 319x360, Views: 653)
* DiceRoller2.zip (Filesize: 84.73 KB, Downloads: 526)
« Last Edit: November 15, 2019, 05:37:29 pm by SierraKen »

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Dice Roller 2 - My First InForm Tool
« Reply #4 on: November 17, 2019, 07:22:05 pm »
I added this program and links to InForm to my website today. Maybe we can get more people to start using it.