Battle Bot - Programming - Python Code - Chicagoland Sportbikes
Chicagoland Sportbikes
 
Open Forum This forum is for all off-topic discussion.

Reply
 
LinkBack Thread Tools Display Modes
post #1 of 119 (permalink) Old 11-21-2010, 12:33 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Battle Bot - Programming - Python Code

Sooooooo WTF!? I'm going CRAZY!!!! This is gonna suck! I've been working on a python code for a "Battle Bot" Thats due for my final tomorrow night and it just won't run right!

I was up till midnight working no it last night with no success! Syntax errors on the global variables and the "Backward" movement isn't returning any results!

Here's the code so far.

#
#By the Programming class of#Programmed by
#start and display menu
def main():
#fuel variables
....used = 0
....fuel = int(200)
....feet = int(0)
#ammo variables
....global ammo
....ammo = int(5)
....global used
....used = int(0)
#movement variables
....block = ''
....dist = 0
....move = int(0)
#general variables
....choice = int(0)
....endProg = 'no'
....print 'Menu Selections: '
....print '1 - Fire Weapon '
....print '2 - Move Forward '
....print '3 - Move Backward '
....print '4 - Exit '
....while endProg == 'no':
........if ammo < 0:
............ammo = int(0)
........if used > 5:
............used = int(5)
........print fuel,'fuel,',used,'used.'
........print ammo,'ammo,',used,'used.'
#check menu selection
choice = raw_input('Enter your selection:')
if choice == '1' or choice == '2' or choice == '3' or choice == '4':
....if int(choice) == 1:
........fire(ammo)
........ammo = ammo - 1
........used = used + 1
....elif int(choice) == 2 or choice == 3:
........if choice == 2:
............dir = 'forward.'
........else:
............dir = 'backward.'
............print('Are there any objects in the way?')
............block = raw_input('Y or N:')
............if block == 'Y' or block == 'y':
................objLoc = int(input('Enter the distance, in feet, the object is:'))
....................feet = input('How far do you want to move?')
....................if feet <= objLoc:
........................if not feet > fuel:
............................fuel = fuel - feet
............................used = used + feet
........................else:
............................print 'Not enough fuel to move that far.'
....................else:
........................print 'There is an object in the way.'

....elif block == 'N' or block == 'n':
........feet = input('How far do you want to move?')
........if not feet > fuel:
............fuel = fuel - feet
............used = used + feet
............print 'Successfully moved',feet,'feet',dir
........else:
............print 'Not enough fuel to move that far.'
....else:
........print 'Error: Invalid selection.'
elif int(choice) == 4:
....print 'Goodbye!'
....exitProg()
else:
....print 'Error: Invalid selection.'
#fire ammo
def fire(ammo):
....if ammo > 0:
........dist = raw_input('Enter the number, in feet, the enemy is:')
........if dist <= '20':
............print 'The enemy had been distroyed.'
............return
........elif dist <= '40':
............print 'The enemy has been partially disabled.'
............return
........else:
............print 'The enemy was not harmed.'
............return
....elif ammo <= 0:
........print('Out of ammo!')
#exit program
def exitProg():
....print 'Y or N:'
....true = raw_input('Do you wish to exit this program?')
....if true == 'y' or true == 'Y':
........quit()
....elif true == 'n' or true == 'N':
........print 'Welcome back.'
........return
....else:
........print 'Error: Invalid selection.'
#call main
main()

THIS SHIT BLOWS!!!!!

edit: Awesome the formating is totally lost... Ugh. Sorta fixed it

Tom

Last edited by IceCold81; 11-22-2010 at 01:33 AM.
IceCold81 is offline  
Sponsored Links
Advertisement
 
post #2 of 119 (permalink) Old 11-21-2010, 12:48 PM
Registered User
 
project15's Avatar
 
Join Date: Apr 2009
Location: Wheeling, IL
Posts: 855
Location: Wheeling, IL
Sportbike: 1998 GSX-R600
Years Riding: 4th season
How you found us: Sportbikes.net
      
Does this actually control a physical robot?

-Chris
project15 is offline  
post #3 of 119 (permalink) Old 11-21-2010, 01:45 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by project15 View Post
Does this actually control a physical robot?
In theory yes

Tom
IceCold81 is offline  
post #4 of 119 (permalink) Old 11-21-2010, 01:52 PM
Registered User
 
project15's Avatar
 
Join Date: Apr 2009
Location: Wheeling, IL
Posts: 855
Location: Wheeling, IL
Sportbike: 1998 GSX-R600
Years Riding: 4th season
How you found us: Sportbikes.net
      
Quote:
Originally Posted by IceCold81 View Post
In theory yes
So in reality, no?

jk, robotics has always interested me. sorry I can't help with the compiling errors.

-Chris
project15 is offline  
post #5 of 119 (permalink) Old 11-21-2010, 01:54 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by project15 View Post
So in reality, no?
My answer.... NO IDEA!

Were not programming a physical robot, our final is to produce a program that replicates results.

Ummmm I want for this class to be OVER and never have to deal with it again! ugh! I HATE programming!

Tom
IceCold81 is offline  
post #6 of 119 (permalink) Old 11-21-2010, 02:48 PM
Registered User
 
Join Date: May 2008
Location: Illinois
Posts: 8,696
Location: Illinois
Sportbike: ninja
Years Riding: since I was a kid
How you found us: K.I.T.T.
           
can you add statements to the code. don't feel like learning python in 90 minutes.


and what are you trying to do with this

....while endProg == 'no':
........if ammo < 0:
............ammo = int(0)
........if used > 5:
............used = int(5)


don't have much time to really debug it thou
taledarkside is offline  
post #7 of 119 (permalink) Old 11-21-2010, 02:54 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by taledarkside View Post
can you add statements to the code. don't feel like learning python in 90 minutes.


and what are you trying to do with this

....while endProg == 'no':
........if ammo < 0:
............ammo = int(0)
........if used > 5:
............used = int(5)


don't have much time to really debug it thou
Essssh man, I've been snipping body context from examples and barely scratching through this.... So it's hard to say clearly but basically if "endProgram" = = NO then the program continues to request next command and ammo is only allowed to be used 5 times before the robot is OUT of ammo, and the robot is limited on Fuel of 200

Tom
IceCold81 is offline  
post #8 of 119 (permalink) Old 11-21-2010, 03:11 PM
Registered User
 
Join Date: May 2008
Location: Illinois
Posts: 8,696
Location: Illinois
Sportbike: ninja
Years Riding: since I was a kid
How you found us: K.I.T.T.
           
dir = 'forward.'


did you make dir a variable?
taledarkside is offline  
post #9 of 119 (permalink) Old 11-21-2010, 03:20 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by taledarkside View Post
dir = 'forward.'


did you make dir a variable?
Thats what I thought I was missing...

Any help in setting the value? I tried under the "movement" variable def: to go with:
dir=

But its not an integer so I don't know what to set it too? Since it can be forward OR backward.... Which the input is string form soooooo I don't know lol

And direction is an issue, because forward returns results but I believe it states you've moved backward, and backward does not return anything just mirrors status of the bot....

Tom

Last edited by IceCold81; 11-21-2010 at 03:27 PM.
IceCold81 is offline  
post #10 of 119 (permalink) Old 11-21-2010, 03:29 PM
yo quiero su taco
 
whiteSeatEnvy's Avatar
 
Join Date: Dec 2002
Location: Woodridge
Posts: 12,745
Location: Woodridge
Sportbike: Honda CBR 954 blk/slvr
Years Riding: 10 years
How you found us: They found me. Follow the white rabbit.
           
I have a BS in computer science, so I've been through all this stuff. And while I don't mean to be a dick, you really shouldn't be having this much trouble. In addition, if you don't have the basics down like the back of your hand, you will not make it through your future programming courses. Spend the time now to learn constructs so they are second nature. It only gets more complex from here. And not having clean, efficient coding will make your life and your team's life hell. Start using comments. Comment variable declaration and method calls, it makes debug easier.

That being said, give us the the program specification for this assignment and I'll try to help out.

"includes 10 used-car dealers or auto repair shops, 11 liquor stores and bars--two of which advertise lingerie fashion shows and a third billed as a "gentlemen's club"--three cut-rate motels and one trailer park. The squat, brick municipal building is next to a currency exchange and a few steps from an adult video store. The bars open at 10 a.m. and close at 6:30 a.m."

Quote:
Originally Posted by admin View Post
Something must be fishy...I am going to go poke around in the back end..

Last edited by whiteSeatEnvy; 11-21-2010 at 03:40 PM.
whiteSeatEnvy is offline  
post #11 of 119 (permalink) Old 11-21-2010, 03:33 PM
Registered User
 
Join Date: May 2008
Location: Illinois
Posts: 8,696
Location: Illinois
Sportbike: ninja
Years Riding: since I was a kid
How you found us: K.I.T.T.
           
icecold only needs this class for requirement. Hes going into scoping which needs no coding.


I dont know python. But you can always set direction as '1' '2' '3' '4' and set another case selection to say

1:
robot moved up
2:
robot moved down
3:
robot moved right
4:
robot moved left


when you play with strings, you have to remember all the rules that language has for it. So sometimes its just easier using numbers.
taledarkside is offline  
post #12 of 119 (permalink) Old 11-21-2010, 03:40 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by whiteSeatEnvy View Post
I have a BS in computer science, so I've been through all this stuff. And while I don't mean to be a dick, you really shouldn't be having this much trouble. In addition, if you don't have the basics down like the back of your hand, you will not make it through your future programming courses. Spend the time now to learn constructs so they are second nature. It only gets more complex from here. And not having clean, efficient coding will make your life and your team's life hell. Start using comments. Comment variable declaration and method calls, it makes debug easier.
Yea this shit is NOT my thing! I dig it for what it is, and understand the logical application behind it, but as far as constructing and compiling this class is ALL that is required in my degree, I'm in CNS/systems

Quote:
Originally Posted by taledarkside View Post
icecold only needs this class for requirement. Hes going into scoping which needs no coding.


I dont know python. But you can always set direction as '1' '2' '3' '4' and set another case selection to say

1:
robot moved up
2:
robot moved down
3:
robot moved right
4:
robot moved left


when you play with strings, you have to remember all the rules that language has for it. So sometimes its just easier using numbers.
This!

Tom

Last edited by IceCold81; 11-21-2010 at 03:46 PM.
IceCold81 is offline  
post #13 of 119 (permalink) Old 11-21-2010, 03:41 PM
yo quiero su taco
 
whiteSeatEnvy's Avatar
 
Join Date: Dec 2002
Location: Woodridge
Posts: 12,745
Location: Woodridge
Sportbike: Honda CBR 954 blk/slvr
Years Riding: 10 years
How you found us: They found me. Follow the white rabbit.
           
Quote:
Originally Posted by taledarkside View Post
icecold only needs this class for requirement. Hes going into scoping which needs no coding.


I dont know python. But you can always set direction as '1' '2' '3' '4' and set another case selection to say

1:
robot moved up
2:
robot moved down
3:
robot moved right
4:
robot moved left


when you play with strings, you have to remember all the rules that language has for it. So sometimes its just easier using numbers.
It is still an indication of his problem solving abilities. He will def still need to hone his skills.

"includes 10 used-car dealers or auto repair shops, 11 liquor stores and bars--two of which advertise lingerie fashion shows and a third billed as a "gentlemen's club"--three cut-rate motels and one trailer park. The squat, brick municipal building is next to a currency exchange and a few steps from an adult video store. The bars open at 10 a.m. and close at 6:30 a.m."

Quote:
Originally Posted by admin View Post
Something must be fishy...I am going to go poke around in the back end..
whiteSeatEnvy is offline  
post #14 of 119 (permalink) Old 11-21-2010, 03:41 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by taledarkside View Post
icecold only needs this class for requirement. Hes going into scoping which needs no coding.


I dont know python. But you can always set direction as '1' '2' '3' '4' and set another case selection to say

1:
robot moved up
2:
robot moved down
3:
robot moved right
4:
robot moved left


when you play with strings, you have to remember all the rules that language has for it. So sometimes its just easier using numbers.
Yea for sure!!! Thats actually a really good suggestion. and right and left aren't even required, so it would only back forward backward or "UP/down" as you listed.

Tom
IceCold81 is offline  
post #15 of 119 (permalink) Old 11-21-2010, 03:45 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by whiteSeatEnvy View Post
It is still an indication of his problem solving abilities. He will def still need to hone his skills.
Yea thats the issue, my problem solving, cuz I'm half way done with my degree with a 4.0gpa but problem solving is my problem.....

The issue is, I don't have hours on end to tear through syntax and programming rules and sequences between my other courses and full time work... And it's not a significant impact on my degree so nor do I intend to... I've gotten through the class thus far just fine, lets remember it's my FIRST (and hopefully last ) programming class AND my FINAL project which isn't intended to be a "PIECE OF CAKE" So stop smack talking and either help a brotha out or

I still have to run this SAME example through Raptor and do the pseudocode... Just as a side note, I ACED my final operating systems lab and exam, which covered a plethora of different tasks related to Boot tasks, security logging, performance modules, administrator rights and allocations, subnetting, and IP addressing schemes etc.... I'd say my problem solving skills aren't necessarily the problem. We all know it doesn't end there, but I'd say I'm rolling with the punches pretty well.

Tom

Last edited by IceCold81; 11-21-2010 at 03:51 PM.
IceCold81 is offline  
post #16 of 119 (permalink) Old 11-21-2010, 03:47 PM
yo quiero su taco
 
whiteSeatEnvy's Avatar
 
Join Date: Dec 2002
Location: Woodridge
Posts: 12,745
Location: Woodridge
Sportbike: Honda CBR 954 blk/slvr
Years Riding: 10 years
How you found us: They found me. Follow the white rabbit.
           
I don't know Python, but right off the bat you have "used" twice, once for fuel and once for ammo.

#fuel variables
....used = 0
....fuel = int(200)
....feet = int(0)
#ammo variables
....global ammo
....ammo = int(5)
....global used
....used = int(0)


........print fuel,'fuel,',used,'used.'
........print ammo,'ammo,',used,'used.'

Did you get a compiler error here?

"includes 10 used-car dealers or auto repair shops, 11 liquor stores and bars--two of which advertise lingerie fashion shows and a third billed as a "gentlemen's club"--three cut-rate motels and one trailer park. The squat, brick municipal building is next to a currency exchange and a few steps from an adult video store. The bars open at 10 a.m. and close at 6:30 a.m."

Quote:
Originally Posted by admin View Post
Something must be fishy...I am going to go poke around in the back end..

Last edited by whiteSeatEnvy; 11-21-2010 at 03:49 PM.
whiteSeatEnvy is offline  
post #17 of 119 (permalink) Old 11-21-2010, 03:52 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by whiteSeatEnvy View Post
I don't know Python, but right off the bat you have "used" twice, once for fuel and once for ammo.

#fuel variables
....fused = 0
....fuel = int(200)
....feet = int(0)
#ammo variables
....global ammo
....ammo = int(5)
....global used
....used = int(0)


........print fuel,'fuel,',used,'used.'
........print ammo,'ammo,',used,'used.'

Did you get a compiler error here?
Hmmmmm good catch! And thats weird cuz it did run the first few times I used it....

Ohh shit, that variable was changed it was originally "fused" under the fuel variables for Fuel used... And yea thats were my compiling error was hitting was in the global variable which would make sense since thats were the variable got duplicated.... Ughhh I'm trying to multi task work right now, and I don't have the damn program in front of me to try anything =(

Tom

Last edited by IceCold81; 11-21-2010 at 03:55 PM.
IceCold81 is offline  
post #18 of 119 (permalink) Old 11-21-2010, 03:53 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by whiteSeatEnvy View Post
And what is objLoc?

objLoc = int(input('Enter the distance, in feet, the object is:'))
ObjLoc is how far the "Object" or enemy is away that the robot is firing at.

By the way thanks for cutting the "Problem solving" low blows and trying to help.

Tom

Last edited by IceCold81; 11-21-2010 at 03:56 PM.
IceCold81 is offline  
post #19 of 119 (permalink) Old 11-21-2010, 03:54 PM
yo quiero su taco
 
whiteSeatEnvy's Avatar
 
Join Date: Dec 2002
Location: Woodridge
Posts: 12,745
Location: Woodridge
Sportbike: Honda CBR 954 blk/slvr
Years Riding: 10 years
How you found us: They found me. Follow the white rabbit.
           
Quote:
Originally Posted by IceCold81 View Post
ObjLoc is how far the "Object" or enemy is away that the robot is firing at.
I see, it's a local variable.

"includes 10 used-car dealers or auto repair shops, 11 liquor stores and bars--two of which advertise lingerie fashion shows and a third billed as a "gentlemen's club"--three cut-rate motels and one trailer park. The squat, brick municipal building is next to a currency exchange and a few steps from an adult video store. The bars open at 10 a.m. and close at 6:30 a.m."

Quote:
Originally Posted by admin View Post
Something must be fishy...I am going to go poke around in the back end..
whiteSeatEnvy is offline  
post #20 of 119 (permalink) Old 11-21-2010, 03:58 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by whiteSeatEnvy View Post
I see, it's a local variable.
I'm still rough when it comes to global vs local variables and in our class they actually say that global variables can often be a less desirable way to go when def variables....? But thats where floating variables gets iffy too...

Tom
IceCold81 is offline  
post #21 of 119 (permalink) Old 11-21-2010, 04:04 PM
yo quiero su taco
 
whiteSeatEnvy's Avatar
 
Join Date: Dec 2002
Location: Woodridge
Posts: 12,745
Location: Woodridge
Sportbike: Honda CBR 954 blk/slvr
Years Riding: 10 years
How you found us: They found me. Follow the white rabbit.
           
Quote:
Originally Posted by IceCold81 View Post
I'm still rough when it comes to global vs local variables and in our class they actually say that global variables can often be a less desirable way to go when def variables....? But thats where floating variables gets iffy too...
local vs global is what is called "scope". All it means is whether the variable is defined inside or outside a method. In other words, in defines whether other methods have access to it. For example, "objLoc" can only be changed/used inside "menu selection". While your global variable "used" can be changed/used by any method.

"includes 10 used-car dealers or auto repair shops, 11 liquor stores and bars--two of which advertise lingerie fashion shows and a third billed as a "gentlemen's club"--three cut-rate motels and one trailer park. The squat, brick municipal building is next to a currency exchange and a few steps from an adult video store. The bars open at 10 a.m. and close at 6:30 a.m."

Quote:
Originally Posted by admin View Post
Something must be fishy...I am going to go poke around in the back end..
whiteSeatEnvy is offline  
post #22 of 119 (permalink) Old 11-21-2010, 04:04 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by whiteSeatEnvy View Post
local vs global is what is called "scope". All it means is whether the variable is defined inside or outside a method.
Ok so yea global can be used throughout modules, and local is defined within module rite?

Tom
IceCold81 is offline  
post #23 of 119 (permalink) Old 11-21-2010, 04:08 PM
yo quiero su taco
 
whiteSeatEnvy's Avatar
 
Join Date: Dec 2002
Location: Woodridge
Posts: 12,745
Location: Woodridge
Sportbike: Honda CBR 954 blk/slvr
Years Riding: 10 years
How you found us: They found me. Follow the white rabbit.
           
Quote:
Originally Posted by IceCold81 View Post
Ok so yea global can be used throughout modules, and local is defined within module rite?
yes, so objLoc is only known in the method Menu Selection. The other methods have no idea what "objLoc" is. However, the whole program including all its methods knows about "used".

To complicate things, the only way to get the value of a local variable to other parts of the program is to pass it as a method parameter.

"includes 10 used-car dealers or auto repair shops, 11 liquor stores and bars--two of which advertise lingerie fashion shows and a third billed as a "gentlemen's club"--three cut-rate motels and one trailer park. The squat, brick municipal building is next to a currency exchange and a few steps from an adult video store. The bars open at 10 a.m. and close at 6:30 a.m."

Quote:
Originally Posted by admin View Post
Something must be fishy...I am going to go poke around in the back end..
whiteSeatEnvy is offline  
post #24 of 119 (permalink) Old 11-21-2010, 04:12 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by whiteSeatEnvy View Post
To complicate things, the only way to get the value of a local variable to other parts of the program is to pass it as a method parameter.
Or "Argument"? I'm just trying to compare what your saying to what they've taught us and the terms I've been basically using ha.

Ugh F#ck! I hope when I get home I can give this another go, and come up with some solid results... I was freaking exhausted last night and just loosing my mind! ha...

Tom

Last edited by IceCold81; 11-21-2010 at 04:14 PM.
IceCold81 is offline  
post #25 of 119 (permalink) Old 11-21-2010, 04:17 PM
yo quiero su taco
 
whiteSeatEnvy's Avatar
 
Join Date: Dec 2002
Location: Woodridge
Posts: 12,745
Location: Woodridge
Sportbike: Honda CBR 954 blk/slvr
Years Riding: 10 years
How you found us: They found me. Follow the white rabbit.
           
Quote:
Originally Posted by IceCold81 View Post
Or "Argument"? I'm just trying to compare what your saying to what they've taught us and the terms I've been basically using ha.

Ugh F#ck! I hope when I get home I can give this another go, and come up with some solid results... I was freaking exhausted last night and just loosing my mind! ha...
It's been a while, but yes I think argument and parameter are the same thing.

"includes 10 used-car dealers or auto repair shops, 11 liquor stores and bars--two of which advertise lingerie fashion shows and a third billed as a "gentlemen's club"--three cut-rate motels and one trailer park. The squat, brick municipal building is next to a currency exchange and a few steps from an adult video store. The bars open at 10 a.m. and close at 6:30 a.m."

Quote:
Originally Posted by admin View Post
Something must be fishy...I am going to go poke around in the back end..
whiteSeatEnvy is offline  
post #26 of 119 (permalink) Old 11-21-2010, 04:21 PM
yo quiero su taco
 
whiteSeatEnvy's Avatar
 
Join Date: Dec 2002
Location: Woodridge
Posts: 12,745
Location: Woodridge
Sportbike: Honda CBR 954 blk/slvr
Years Riding: 10 years
How you found us: They found me. Follow the white rabbit.
           
If you have the program specification (the program assignment instructions) post them up. I would need to see what the instructor wants you to do for this programming assignment.

"includes 10 used-car dealers or auto repair shops, 11 liquor stores and bars--two of which advertise lingerie fashion shows and a third billed as a "gentlemen's club"--three cut-rate motels and one trailer park. The squat, brick municipal building is next to a currency exchange and a few steps from an adult video store. The bars open at 10 a.m. and close at 6:30 a.m."

Quote:
Originally Posted by admin View Post
Something must be fishy...I am going to go poke around in the back end..
whiteSeatEnvy is offline  
post #27 of 119 (permalink) Old 11-21-2010, 04:54 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
Quote:
Originally Posted by whiteSeatEnvy View Post
If you have the program specification (the program assignment instructions) post them up. I would need to see what the instructor wants you to do for this programming assignment.
Here ya go man:
  1. Write a program for a Robot BattleBot that satisfies these conditions:
  2. Should have the following command menu selections: Fire a weapon, Move forward, Move Backward, exit.
  3. If Fire weapon command is given, the user should be prompted to enter how far away (in feet) the enemy bot is, if within 20 feet, a message should be displayed that the opponent is destroyed: if within 40 feet the message should say it is partially disabled: if it is over 40 feet away it should say "Unharmed", The battle bot has enough ammunition to fire it's weapon 5 times in totall. If it is out of ammunition is should display a message that it cannot fire anymore when the fire weapon command is given.
  4. If the move forward command is given, the user should be prompted to enter how far they want to go and then how far away in feet that any obstacles are in front of the bot. If an obstacle is blocking the battlebots path, then the battlebot should print a message saying it is blocked, and how far it can move forward. If the battlebot is NOT blocked it should display a message that it can move the entire distance and state the distance.
  5. The move backward command should work the same way as the forward command.
  6. The battleBot should keep track of how far it travels. It has enough fuel to travel 200 feet in total. If it runs out of fuel, it should display a message that it is out of fuel when the move forward or backward command is given.....

Tom
IceCold81 is offline  
post #28 of 119 (permalink) Old 11-21-2010, 08:01 PM Thread Starter
Lookin to Ride!
 
IceCold81's Avatar
 
Join Date: May 2008
Location: Plainfield IL.
Posts: 4,459
Location: Plainfield IL.
Sportbike: 2008 CBR 1000RR and 2010 Victory Jackpot premium
Years Riding: One could say, I've been around the block a few times....
How you found us: Through the "GrapeVine"
           
This shit is NOT happening!!!!!!

I just can't make the connections that are needed to reflect everything in it's entirety..... Anything I come up with either doesn't reflect any results, partial results, cycles through the same menu selection or what have you, I get compiler errors or whatever.... I got a BAD feeling about this, and if I can't produce on this before tomorrow nights class, I GUARANTEE I'm gonna fail this class! I fucking HATE this shit!

And it doesn't help that this book for this class is complete SHIT!

I'm getting desperate here! ha, I'm ready to pay $$$ for this shit!

Tom

Last edited by IceCold81; 11-21-2010 at 08:06 PM.
IceCold81 is offline  
post #29 of 119 (permalink) Old 11-21-2010, 08:23 PM
lust for bikes!
 
nouseforaname's Avatar
 
Join Date: Jun 2008
Location: a prostitute
Posts: 3,941
Location: a prostitute
Sportbike: a prostitute
Years Riding: a prostitute
How you found us: a prostitute
           
u guys need to get a room! fo realz!!



"Why are all these people here? There are too many people on this earth. We need a new plague…"

"Thats it, nobody gets out of here alive."

Quote:
Originally Posted by JRobbins View Post
I agree completely with Steve (nouseforaname)
nouseforaname is offline  
post #30 of 119 (permalink) Old 11-21-2010, 08:26 PM
U-P-G-R-A-Y-E-D-D
 
FiReBReTHa's Avatar
 
Join Date: Apr 2006
Location: Aurora, IL
Posts: 11,172
Location: Aurora, IL
Sportbike: 04 GSXR6
Years Riding: 2
How you found us: I thought it was a line for muffins
           
Send a message via AIM to FiReBReTHa
Quote:
Originally Posted by nouseforaname View Post
u guys need to get a room! fo realz!!




fuck that shit, just get two swords and have it out in the class.



Just do what I do, make an android and then force him to program your robots, much easier.
FiReBReTHa is offline  
Reply

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the Chicagoland Sportbikes forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome