Author Topic: Some code  (Read 4507 times)

Gohst

  • Regular
  • **
  • Posts: 31
    • View Profile
    • http://mybrain.ej.am
    • Email
Some code
« on: 2005-09-12, 11:18:24 PM »
Howdy.

Wondering if you could code a program that looks like this:
http://www.imagexoom.com/uploads/untitled_copy17.jpg
so you type one number in one side and one number in the other side then click the button and it picks a random number between them.

Can you compile it to an .exe? My version of VB killed itself the other day and besides I never used it anyway so I uninstalled it.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Some code
« Reply #1 on: 2005-09-13, 05:10:37 AM »
http://enigmadream.com/files/Random.zip
... and if you can convince me I'm not doing your homework I can also provide the source code ;)
I'd be interested to know what this is for anyway (even if you don't need the source code).

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Some code
« Reply #2 on: 2005-09-13, 05:14:58 AM »
BTW, I think this could be done as an Excel spreadsheet too.  Do you have Excel

Gohst

  • Regular
  • **
  • Posts: 31
    • View Profile
    • http://mybrain.ej.am
    • Email
Some code
« Reply #3 on: 2005-09-13, 06:38:16 AM »
Thanks man! Would have rocked if it had Random Number in the title thing, whatever its called.

I don't want the source code. I don't understand that stuff, besides I have no use for it.

Its not for my homework.

I used to be Faithless-TheWonderboy on the old forum. But now since I've moved on I've become a game reviewer! Thing is, I've got so many games to review I wanted to pick one at random. So I wanted a random number thing to pick which game to play. I put in how many games I've got and it picks a number, so I play whatever game corresponds.

There ya go. :)

bat

  • Fanatic
  • ***
  • Posts: 234
  • Cheak out the B*t project
    • MSN Messenger - ethanbatmay@hotmail.com
    • Yahoo Instant Messenger - ethanbatmay
    • View Profile
    • The B*t project
    • Email
Re: Some code
« Reply #4 on: 2005-12-13, 07:32:44 PM »
could i get the source code?
~bat

bat

  • Fanatic
  • ***
  • Posts: 234
  • Cheak out the B*t project
    • MSN Messenger - ethanbatmay@hotmail.com
    • Yahoo Instant Messenger - ethanbatmay
    • View Profile
    • The B*t project
    • Email
Re: Some code
« Reply #5 on: 2005-12-13, 07:39:09 PM »
i would really like to get into scripting and programming, but i have no idea where to start...
~bat

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Some code
« Reply #6 on: 2005-12-13, 07:58:00 PM »
I don't have the source code any more.  I don't think the source code to that will help you with scripting nearly as much as looking at existing scripts because the source code was written in VB6, which is not a scripting language.  Have you tried following the "Scripting Docutorial" found in the "Scripting Documentation" book in the help file?

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: Some code
« Reply #7 on: 2005-12-13, 10:52:37 PM »
Knowing basic programming logic is a great help when getting started (or starting when you're 6, like I did).  And to do that, knowing basic logic in general is a great help.  Things like "Not A and Not B" is the same as "Not (A or B)".

Once you know basic logic and you figure out basic programming layout, you can benefit a lot more from looking at the scripts than without it.

Program flow, for example, can be controlled through (most simply) the use of if, do, while, for, and select case statements.  Other things include calling functions and returning values, and doing (of course) mathematics or some such.  I won't try to go into too much more detail right here, since generally they teach you this stuff over the course of a semester at college level (though IMO it could go a lot faster).  But if you have any questions about anything in particular, feel free to ask.  However, BlueMonk is definetely right.  You should take a look at the Scripting Docutorial first things first.
Edward Dassmesser

Zorb Burger

  • Guest
Re: Some code
« Reply #8 on: 2005-12-13, 10:55:46 PM »
MATH SUX... dat wat I think.

Thank a goodness i won't be doin' no prograhmin'

Gohst

  • Regular
  • **
  • Posts: 31
    • View Profile
    • http://mybrain.ej.am
    • Email
Re: Some code
« Reply #9 on: 2006-12-01, 12:27:02 AM »
Don't suppose you've still got that random number program laying around, do you Ben?

bat

  • Fanatic
  • ***
  • Posts: 234
  • Cheak out the B*t project
    • MSN Messenger - ethanbatmay@hotmail.com
    • Yahoo Instant Messenger - ethanbatmay
    • View Profile
    • The B*t project
    • Email
Re: Some code
« Reply #10 on: 2006-12-01, 12:57:46 AM »
lol  good old source code!
~bat

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Some code
« Reply #11 on: 2006-12-01, 06:49:44 AM »
Don't suppose you've still got that random number program laying around, do you Ben?

I probably deleted it knowing I could make it again in 5 minutes or less if I needed to (or even by accident -- "oops, I made a random number program again!" ;)).

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: Some code
« Reply #12 on: 2006-12-01, 09:22:32 AM »
If you have Excel, just open a new spreadsheet and put this formula as the value for C1:

=ROUND((RAND() * B1-A1) + A1,0)

Then type in the numbers you want to go between in A1 and B1.  Any time you want to regenerate a number, just double-click on C1 then click somewhere else.
Edward Dassmesser