|
-
Oct 15th, 2013, 12:26 PM
#51881
Re: Post Race!
 Originally Posted by dday9
Basically the whole process behind it is that there is no such thing as a 2d primitive, only 3d primitives that look 2d.
How very primitive.
My usual boring signature: Nothing
 
-
Oct 15th, 2013, 12:34 PM
#51882
-
Oct 15th, 2013, 12:35 PM
#51883
-
Oct 15th, 2013, 02:13 PM
#51884
Re: Post Race!
If anyone can compile Python, this is what I've come up with after only a few days of working with Python:
Code:
import datetime
#The customer and policy class
class customer:
last = ""
first = ""
dob = datetime.MINYEAR
address = ""
city = ""
state = ""
zip = 0
policies = []
class policy:
holder = customer
number = 0
location = ""
city = ""
state = ""
zip = 0
premium = 0
effective = datetime.MINYEAR
expiration = datetime.MAXYEAR
#These are the main menus
def main_menu():
print ("Main - Menu")
print ("___________")
print ("Search - 1")
print ("Add - 2")
print ("Remove - 3")
print ()
return int(input())
def search_menu():
print ("Search - Menu")
print ("__________________")
print ("Last Name - 1")
print ("Policy Number - 2")
print ("Main Menu - 3")
print ()
return int(input())
def add_menu():
print ("Add - Menu")
print ("________________")
print ("Add Customer - 1")
print ("Add Policy - 2")
print ("Main Menu - 3")
print ()
return int(input())
def remove_menu():
print ("Remove - Menu")
print ("_________________")
print ("Last Name - 1")
print ("Policy Number - 2")
print ("Main Menu - 3")
print ()
return int(input())
#These are the sub menus
#Search Sub Menu(s)
def sub_search_name():
#Search by last name
print ("Please enter the last name. To return to the search menu, enter 'return'")
name = input()
if name == "return":
return None
else:
return name
def sub_search_number():
#Search by policy number
print ("Please enter the policy number. To return to the search menu, enter 'return'")
policy = input()
if policy == "return":
return None
else:
return int(policy)
#Add Sub Menu(s)
def sub_add_customer():
#Add Customer
foo_customer = customer
print ("If at any point you wish to cancel, enter in 'return'")
questions = ["Please enter in the new customer's last name: ",
"Please enter in the new customer's first name: ",
"Please enter in the new customer's date of birth: ",
"Please enter in the new customer's address: ",
"Please enter in the new customer's city: ",
"Please enter in the new customer's state: ",
"Please enter in the new customer's zip: ",]
answers = []
for foo_question in questions:
foo_answer = input(foo_question)
if foo_answer in ["return", ""]:
return None
else:
answers.append(foo_answer)
foo_customer.last, foo_customer.first, foo_customer.dob, foo_customer.address, foo_customer.city, foo_customer.state, foo_customer.zip = answers
print ()
print (foo_customer.first + " " + foo_customer.last)
print (str(foo_customer.dob))
print (foo_customer.address)
print (foo_customer.city + " " + foo_customer.state + " " + foo_customer.zip)
print ()
print("Are you sure you want to add this customer? y = yes or n = no")
i = False
while i == False:
confirm = input()
if confirm == "n":
i = True
return None
elif confirm == "y":
i = True
return foo_customer
else:
print ("Invalid input.")
def sub_add_policy():
#Add Policy
foo_policy = policy
print ("If at any point you wish to cancel, enter in 'return'")
questions = ["Please enter in the new policy number: ",
"Please enter in the new policy's physical address: ",
"Please enter in the new policy's physical city: ",
"Please enter in the new policy's physical state: ",
"Please enter in the new policy's physical zip: ",
"Please enter in the new policy's premium: ",
"Please enter in the new policy's effective date: ",
"Please enter in the new policy's expiration date: ",
]
answers = []
for foo_question in questions:
foo_answer = input(foo_question)
if foo_answer in ["return", ""]:
return None
else:
answers.append(foo_answer)
foo_policy.number, foo_policy.location, foo_policy.city, foo_policy.state, foo_policy.zip, foo_policy.premium, foo_policy.effective, foo_policy.expiration = answers
print ()
print (foo_policy.number)
print (foo_policy.location + " " + foo_policy.state + " " + foo_policy.zip)
print (foo_policy.premium)
print (str(foo_policy.effective))
print (str(foo_policy.expiration))
print ()
print("Are you sure you want to add this policy? y = yes or n = no")
i = False
while i == False:
confirm = input()
if confirm == "n":
i = True
return None
elif confirm == "y":
i = True
return foo_policy
else:
print ("Invalid input.")
#Remove Sub Menu(s)
def sub_remove_name():
#Search by last name
print ("Please enter the last name. To return to the remove menu, enter 'return'")
name = input()
if name == "return":
return None
else:
return name
def sub_remove_number():
#Search by policy number
print ("Please enter the policy number. To return to the remove menu, enter 'return'")
policy = input()
if policy == "return":
return None
else:
return int(policy)
#The main boolean should always be true until
#The program closes
main = True
#These booleans will determine which main menu will be shown
main_bool = False
search_bool = True
add_bool = True
remove_bool = True
while main == True:
if main_bool == False:
#Main Menu - Main
while main_bool == False:
main_int = main_menu()
if main_int == 1:
#Go to: Main Menu - Search
search_bool = False
main_bool = True
elif main_int == 2:
#Go to: Main Menu - Add
add_bool = False
main_bool = True
elif main_int == 3:
#Go to: Main Menu - Remove
remove_bool = False
main_bool = True
else:
print ("Invalid Input.")
elif search_bool == False:
#Main Menu - Search
while search_bool == False:
search_int = search_menu()
if search_int == 1:
#Go To: Sub Menu - Search By Last Name
search_last = False
while search_last == False:
last_int = sub_search_name()
search_last = True
elif search_int == 2:
#Go To: Sub Menu - Search By Policy Number
search_policy = False
while search_policy == False:
policy_int = sub_search_number()
search_policy = True
elif search_int == 3:
#Return to the Main Menu - Main
main_bool = False
search_bool = True
else:
print ("Invalid Input.")
elif add_bool == False:
#Main Menu - Add
while add_bool == False:
add_int = add_menu()
if add_int == 1:
#Go To: Sub Menu - Add Customer
customer_bool = False
while customer_bool == False:
foo_customer = sub_add_customer()
customer_bool = True
elif add_int == 2:
#Go To: Sub Menu - Add Policy
policy_bool = False
while policy_bool == False:
foo_policy = sub_add_policy()
policy_bool = True
elif add_int == 3:
#Return to the Main Menu - Main
main_bool = False
add_bool = True
else:
print ("Invalid Input.")
elif remove_bool == False:
#Main Menu - Remove
while remove_bool == False:
remove_int = remove_menu()
if remove_int == 1:
#Go To: Sub Menu - Remove By Last Name
search_last = False
while search_last == False:
last_int = sub_remove_name()
elif remove_int == 2:
#Go To: Sub Menu - Remove By Policy Number
search_policy = False
while search_policy == False:
policy_int = sub_remove_number()
search_policy = True
elif remove_int == 3:
main_bool = False
remove_bool = True
else:
print ("Invalid Input.")
-
Oct 15th, 2013, 02:20 PM
#51885
Re: Post Race!
I haven't figured out to properly parse data types yet. Right now, for example if I return an integer I'm just calling int(<string>). That's the same as calling CInt(<string>) in vb.net. I need to find a TryParse or something to that effect.
-
Oct 17th, 2013, 09:59 AM
#51886
Re: Post Race!
Since I've set up Google Analytics I've had 11 people visit my snippet website! I feel pretty cool knowing I made my own website 8^]
-
Oct 18th, 2013, 07:37 AM
#51887
My usual boring signature: Nothing
 
-
Oct 18th, 2013, 08:43 AM
#51888
Re: Post Race!
Did I miss something? I went to look at something in the MSDN library today and the default VS option it gave me was VS 2013.
-
Oct 18th, 2013, 08:44 AM
#51889
Re: Post Race!
Is there now a VS 2013 and if so... why?!
-
Oct 18th, 2013, 07:41 PM
#51890
Re: Post Race!
Yes, there is. I just got an email from MS about it. I believe it has to do with the rapidly changing face of Win8. The new tools are for Win8 development.
Other than that I would guess it would be to generate new revenue.
My usual boring signature: Nothing
 
-
Oct 23rd, 2013, 04:09 PM
#51891
Re: Post Race!
The post race will never die.
-
Oct 24th, 2013, 01:42 AM
#51892
Addicted Member
Re: Post Race!
Banana banana, banana banana,
Body Language tells the truth! even from the grave tsaeb eht morf gninnur ,nwod deaH
All the big things started from little! teef my tsap evom sekans ,duol raor slluB
Lietome.ir
-
Oct 24th, 2013, 12:49 PM
#51893
-
Oct 24th, 2013, 12:52 PM
#51894
-
Oct 27th, 2013, 08:12 AM
#51895
Addicted Member
Body Language tells the truth! even from the grave tsaeb eht morf gninnur ,nwod deaH
All the big things started from little! teef my tsap evom sekans ,duol raor slluB
Lietome.ir
-
Oct 27th, 2013, 11:50 AM
#51896
Re: Post Race!
I have nothing to say to that, so I'll not say it here.
My usual boring signature: Nothing
 
-
Oct 29th, 2013, 05:07 PM
#51897
Re: Post Race!
Debug this:
Code:
Module Module1
Private tmr As New Timers.Timer
Private s As New Snake
Private grid As New Rectangle
Private playing As Boolean = False
Sub Main()
AddHandler tmr.Elapsed, AddressOf tmr_tick
grid.location = New Point(0, 0)
grid.size = New Size(15, 15)
Call NewGame()
Do Until True = False
If playing = False AndAlso Console.ReadKey(True).Key = ConsoleKey.Spacebar Then
playing = True
tmr.Start()
ElseIf playing = True AndAlso Console.ReadKey(True).Key = ConsoleKey.LeftArrow Then
s.direction = Direction.Left
ElseIf playing = True AndAlso Console.ReadKey(True).Key = ConsoleKey.RightArrow Then
s.direction = Direction.Right
ElseIf playing = True AndAlso Console.ReadKey(True).Key = ConsoleKey.UpArrow Then
s.direction = Direction.Up
ElseIf playing = True AndAlso Console.ReadKey(True).Key = ConsoleKey.DownArrow Then
s.direction = Direction.Down
End If
Loop
End Sub
Private Sub tmr_tick(sender As Object, e As Timers.ElapsedEventArgs)
s.prior_location = s.location
Select Case s.direction
Case Direction.Left
s.location = New Point(s.prior_location.x - 1, s.prior_location.y)
Case Direction.Right
s.location = New Point(s.prior_location.x + 1, s.prior_location.y)
Case Direction.Up
s.location = New Point(s.prior_location.x, s.prior_location.y - 1)
Case Direction.Down
s.location = New Point(s.prior_location.x, s.prior_location.y + 1)
End Select
Console.CursorLeft = s.prior_location.x
Console.CursorTop = s.prior_location.y
Console.Write(" ")
'Collision!
If grid.IntersectsWith(s.location) Then
playing = False
tmr.Stop()
Call NewGame()
End If
Call DrawSnake(s)
End Sub
Private Sub NewGame()
playing = False
Call DrawRect(grid.location, grid.size)
With s
.direction = Direction.Right
.location = New Point(1, 1)
.prior_location.x = Nothing
.prior_location.y = Nothing
.speed = 250
End With
tmr.Interval = s.speed
End Sub
Private Sub DrawRect(ByVal pt As Point, ByVal siz As Size)
Dim x, y, wid, hei As Integer
x = pt.x : y = pt.y
wid = siz.width : hei = siz.height
Console.ForegroundColor = ConsoleColor.Green
Console.CursorLeft = x
Console.CursorTop = y
'Draw the top line
For start As Integer = 0 To wid
Console.Write("-")
Next
Console.CursorLeft = x
Console.CursorTop = y + 1
'Draw the left line
For start As Integer = 0 To hei - 2
Console.Write("|")
Console.CursorLeft -= 1
Console.CursorTop += 1
Next
Console.CursorLeft = x
Console.CursorTop = y + hei
'Draw the bottom line
For start As Integer = 0 To wid
Console.Write("-")
Next
Console.CursorLeft = x + wid
Console.CursorTop = y + 1
'Draw the right line
For start As Integer = 0 To hei - 2
Console.Write("|")
Console.CursorLeft -= 1
Console.CursorTop += 1
Next
End Sub
Private Sub DrawSnake(ByVal snake As Snake)
If snake.prior_location.x <> Nothing AndAlso snake.prior_location.y <> Nothing Then
Console.CursorLeft = snake.prior_location.x
Console.CursorTop = snake.prior_location.y
Console.Write("")
End If
Console.CursorLeft = snake.location.x
Console.CursorTop = snake.location.y
Console.Write("@")
End Sub
Structure Point
Public x As Integer
Public y As Integer
Sub New(p1 As Integer, p2 As Integer)
Me.x = p1
Me.y = p2
End Sub
End Structure
Structure Size
Public width As Integer
Public height As Integer
Sub New(s1 As Integer, s2 As Integer)
Me.width = s1
Me.height = s2
End Sub
End Structure
Structure Rectangle
Public location As Point
Public size As Size
Public Function IntersectsWith(ByVal pt As Point) As Boolean
If pt.x <= location.x OrElse pt.x >= location.x + size.width Then
Return True
ElseIf pt.y < location.y OrElse pt.y >= location.y + size.height Then
Return True
Else
Return False
End If
End Function
End Structure
Enum Direction
Up
Down
Left
Right
End Enum
Structure Snake
Public location As Point
Public prior_location As Point
Public direction As Direction
Public speed As Integer
End Structure
End Module
Its a fun little console app game.
-
Oct 30th, 2013, 01:30 PM
#51898
Re: Post Race!
Did you make a snake game? Where's the part where it downloads spyware onto the users computer?
My usual boring signature: Nothing
 
-
Oct 30th, 2013, 01:41 PM
#51899
Re: Post Race!
Ha, it's kind of like snake only the snake doesn't grow. It's just a stay in bounds game. And I don't know how to make spyware, nor do I want to know how.
-
Oct 30th, 2013, 02:37 PM
#51900
Re: Post Race!
 Originally Posted by Shaggy Hiker
Did you make a snake game? Where's the part where it downloads spyware onto the users computer?
LOL That was funniest thread I ever read on this site. Had me in stitches.
-
Oct 30th, 2013, 03:38 PM
#51901
Re: Post Race!
Various people have made snake games over the years, but due to that one infamous thread (probably the most entertaining thread in the history of this site), whenever anybody mentions a snake game I always expect it to be a joke.
My usual boring signature: Nothing
 
-
Nov 6th, 2013, 05:50 AM
#51902
New Member
Re: Post Race!
How I made date trial on vb6 PLZ Help .
-
Nov 6th, 2013, 09:29 AM
#51903
Re: Post Race!
First, upgrade to visual basic.net. Next post a thread in the vb.net section :]
-
Nov 6th, 2013, 09:30 AM
#51904
Re: Post Race!
Nah I'm joking(but not really). I have no idea as I've never worked with vb6.
-
Nov 6th, 2013, 09:31 AM
#51905
Re: Post Race!
And by date trial I assume you mean a trial period you can use your program before you have to purchase a product key or something along those lines.
-
Nov 6th, 2013, 09:31 AM
#51906
-
Nov 6th, 2013, 09:32 AM
#51907
Re: Post Race!
I mean I know I'm off, but am I off on your question?
-
Nov 6th, 2013, 09:40 AM
#51908
Re: Post Race!
At times it might seem like you are all by yourself in this thread - but do realize - we are watching you...
-
Nov 6th, 2013, 10:08 AM
#51909
Re: Post Race!
 Originally Posted by szlamany
At times it might seem like you are all by yourself in this thread - but do realize - we are watching you...
Just like the NSA!
-
Nov 6th, 2013, 10:08 AM
#51910
-
Nov 6th, 2013, 10:09 AM
#51911
-
Nov 6th, 2013, 10:09 AM
#51912
-
Nov 6th, 2013, 10:10 AM
#51913
-
Nov 6th, 2013, 10:11 AM
#51914
-
Nov 6th, 2013, 10:12 AM
#51915
Re: Post Race!
That last one is my favorite because it reminds me of my brother. Lol.
-
Nov 6th, 2013, 10:12 AM
#51916
Re: Post Race!
I'm sure I've just been placed on a "Watch List".
-
Nov 6th, 2013, 10:13 AM
#51917
Re: Post Race!
Man, they will be super bored!
-
Nov 6th, 2013, 10:14 AM
#51918
Re: Post Race!
Beginning of Day - 8:29: Inactivity
8:30 - 5:28: Vbforums
5:29 - 5:30: Work
5:31 - End Of Day: Inactivity
-
Nov 6th, 2013, 01:19 PM
#51919
Re: Post Race!
I am trying to come up with some kind of joke about watch lists, but it's just not happening for me. There should be a joke there since watch has several different meanings, but nothing seems worth saying.
My usual boring signature: Nothing
 
-
Nov 6th, 2013, 01:20 PM
#51920
Re: Post Race!
On the other hand, is it possible to come up with a programming object called a Watch List? Perhaps it would be lit a List(of T) that raised events when items were added and removed. Such a thing probably exists, but if not, it could reasonably be called a Watch List.
My usual boring signature: Nothing
 
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|