Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Need someone to write extremely simple program for me.
New Posts  All Forums:Forum Nav:

Need someone to write extremely simple program for me. - Page 2

post #11 of 34
Quote:
Originally Posted by thrasherht View Post
so i just figured out how to generate two random number with a given range just by pushing a button, so now i need to figure out how to have a square that has a position then i can have those numbers be put into the coordinance for the square.
(I can't spell)
MaxRes is a variable for the screen width/height (i.e. 1920) and it will return a psuedo-random number from 1 to 1920. Don't forget running this twice will only provide a point. You need to compensate for the area of the square as well.

Randomize
Int(MaxRes * Rnd)
Once again...
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 [4.28GHz, HT] Asus P6T + Broadcom NetXtreme II VisionTek HD5850 [900/1200] + Galaxy GT240 2x4GB G.Skill Ripjaw X [1632 MHz] 
Hard DriveOSMonitorKeyboard
Intel X25-M 160GB + 3xRAID0 500GB 7200.12 Window 7 Pro 64 Acer H243H + Samsung 226BW XARMOR-U9BL  
PowerCaseMouseMouse Pad
Antec Truepower New 750W Li Lian PC-V2100 [10x120mm fans] Logitech G9 X-Trac Pro 
  hide details  
Reply
Once again...
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 [4.28GHz, HT] Asus P6T + Broadcom NetXtreme II VisionTek HD5850 [900/1200] + Galaxy GT240 2x4GB G.Skill Ripjaw X [1632 MHz] 
Hard DriveOSMonitorKeyboard
Intel X25-M 160GB + 3xRAID0 500GB 7200.12 Window 7 Pro 64 Acer H243H + Samsung 226BW XARMOR-U9BL  
PowerCaseMouseMouse Pad
Antec Truepower New 750W Li Lian PC-V2100 [10x120mm fans] Logitech G9 X-Trac Pro 
  hide details  
Reply
post #12 of 34
Thread Starter 
wonderful! thank you so much.
Acer Aspire 5720Z
(13 items)
 
  
CPUGraphicsRAMHard Drive
1.6ghz Pentium-D Intel 2gb 250gb 
Optical DriveOSMonitor
DVD-RW openSUSE 11.4 15" 
  hide details  
Reply
Acer Aspire 5720Z
(13 items)
 
  
CPUGraphicsRAMHard Drive
1.6ghz Pentium-D Intel 2gb 250gb 
Optical DriveOSMonitor
DVD-RW openSUSE 11.4 15" 
  hide details  
Reply
post #13 of 34
Quote:
Originally Posted by DuckieHo View Post
MaxRes is a variable for the screen width/height (i.e. 1920) and it will return a psuedo-random number from 1 to 1920. Don't forget running this twice will only provide a point. You need to compensate for the area of the square as well.

Randomize
Int(MaxRes * Rnd)
so i can use maxres instead of a number to get a variable that will be according to screen size rather then a predetermined number?

how can i do something that will do like maxres minus 100 or something?

I also need to make the pushbutton work for the spacebar.

the program that i have so far is attached.

it is setup for a program that is 800 x 600 on the screen.
post #14 of 34
Thread Starter 
any chance you could post up the source code when the program is finished? I'd like to be able to compile it for both Linux and Windows.
Acer Aspire 5720Z
(13 items)
 
  
CPUGraphicsRAMHard Drive
1.6ghz Pentium-D Intel 2gb 250gb 
Optical DriveOSMonitor
DVD-RW openSUSE 11.4 15" 
  hide details  
Reply
Acer Aspire 5720Z
(13 items)
 
  
CPUGraphicsRAMHard Drive
1.6ghz Pentium-D Intel 2gb 250gb 
Optical DriveOSMonitor
DVD-RW openSUSE 11.4 15" 
  hide details  
Reply
post #15 of 34
Quote:
Originally Posted by thrasherht View Post
so i can use maxres instead of a number to get a variable that will be according to screen size rather then a predetermined number?

how can i do something that will do like maxres minus 100 or something?

I also need to make the pushbutton work for the spacebar.

the program that i have so far is attached.

it is setup for a program that is 800 x 600 on the screen.
This should give your the coordinate of the upper right corner of a 10x10 box on a 1280x1024 screen:

Code:
 
Dim ScreenHeight as Integer
Dim ScreenWidth as Integer
Dim BoxHeight as Integer
Dim BoxWidth as Integer
Dim VerticalPosition as Integer
Dim HorizontalPosition as Integer
 
ScreenHeight = 1280
ScreenWidth = 1024
BoxHeight = 10
BoxWidth = 10
 
Randomize
VerticalPosition = Int((ScreenHeight - BoxHeight) * Rnd) + BoxHeight
HorizontalPosition = Int((ScreenWidth - BoxWidth) * Rnd) + BoxWidth

Edited by DuckieHo - 1/19/11 at 10:29am
Once again...
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 [4.28GHz, HT] Asus P6T + Broadcom NetXtreme II VisionTek HD5850 [900/1200] + Galaxy GT240 2x4GB G.Skill Ripjaw X [1632 MHz] 
Hard DriveOSMonitorKeyboard
Intel X25-M 160GB + 3xRAID0 500GB 7200.12 Window 7 Pro 64 Acer H243H + Samsung 226BW XARMOR-U9BL  
PowerCaseMouseMouse Pad
Antec Truepower New 750W Li Lian PC-V2100 [10x120mm fans] Logitech G9 X-Trac Pro 
  hide details  
Reply
Once again...
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 [4.28GHz, HT] Asus P6T + Broadcom NetXtreme II VisionTek HD5850 [900/1200] + Galaxy GT240 2x4GB G.Skill Ripjaw X [1632 MHz] 
Hard DriveOSMonitorKeyboard
Intel X25-M 160GB + 3xRAID0 500GB 7200.12 Window 7 Pro 64 Acer H243H + Samsung 226BW XARMOR-U9BL  
PowerCaseMouseMouse Pad
Antec Truepower New 750W Li Lian PC-V2100 [10x120mm fans] Logitech G9 X-Trac Pro 
  hide details  
Reply
post #16 of 34
Thread Starter 
oh wait....if it's VB than I probably can't compile for Linux, lol.
Acer Aspire 5720Z
(13 items)
 
  
CPUGraphicsRAMHard Drive
1.6ghz Pentium-D Intel 2gb 250gb 
Optical DriveOSMonitor
DVD-RW openSUSE 11.4 15" 
  hide details  
Reply
Acer Aspire 5720Z
(13 items)
 
  
CPUGraphicsRAMHard Drive
1.6ghz Pentium-D Intel 2gb 250gb 
Optical DriveOSMonitor
DVD-RW openSUSE 11.4 15" 
  hide details  
Reply
post #17 of 34
Quote:
Originally Posted by Kernel Klink View Post
oh wait....if it's VB than I probably can't compile for Linux, lol.
You could setup wine and run it with that.
post #18 of 34
I'm working on a java version. Give me a few minutes.
    
CPUMotherboardGraphicsRAM
Core i5 750 4.01ghz at 1.27v MSI P55 GD-80 Sapphire Radeon HD 5870 1GB + EVGA 9800GT Physx G.SKILL 4GB DDR3 1600mhz 
Hard DriveOptical DriveOSMonitor
Crucial 128gb Real SSD, WD Black 500gb, 750gb LG DVD combo Windows 7 Ultimate 64 / Arch Linux x64 22" Acer 
PowerCase
Corsair HX750 Corsair 600t 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Core i5 750 4.01ghz at 1.27v MSI P55 GD-80 Sapphire Radeon HD 5870 1GB + EVGA 9800GT Physx G.SKILL 4GB DDR3 1600mhz 
Hard DriveOptical DriveOSMonitor
Crucial 128gb Real SSD, WD Black 500gb, 750gb LG DVD combo Windows 7 Ultimate 64 / Arch Linux x64 22" Acer 
PowerCase
Corsair HX750 Corsair 600t 
  hide details  
Reply
post #19 of 34
here is a final version of the program that is using 1024x768.

pushing the space bar changes the position of the square.
post #20 of 34
Here is my version. I'm doing distributions for Linux and Mac right now.
    
CPUMotherboardGraphicsRAM
Core i5 750 4.01ghz at 1.27v MSI P55 GD-80 Sapphire Radeon HD 5870 1GB + EVGA 9800GT Physx G.SKILL 4GB DDR3 1600mhz 
Hard DriveOptical DriveOSMonitor
Crucial 128gb Real SSD, WD Black 500gb, 750gb LG DVD combo Windows 7 Ultimate 64 / Arch Linux x64 22" Acer 
PowerCase
Corsair HX750 Corsair 600t 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Core i5 750 4.01ghz at 1.27v MSI P55 GD-80 Sapphire Radeon HD 5870 1GB + EVGA 9800GT Physx G.SKILL 4GB DDR3 1600mhz 
Hard DriveOptical DriveOSMonitor
Crucial 128gb Real SSD, WD Black 500gb, 750gb LG DVD combo Windows 7 Ultimate 64 / Arch Linux x64 22" Acer 
PowerCase
Corsair HX750 Corsair 600t 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Need someone to write extremely simple program for me.