User Profile

Collapse

Profile Sidebar

Collapse
telgroc
telgroc
Last Activity: Feb 20 '14, 02:42 AM
Joined: Oct 28 '08
Location: PA/CT
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • telgroc
    started a topic Battleship

    Battleship

    I'm trying to write the code for the game Battleship, in order to count how many turns it will take to sink all 5 ships. I've written it without strategy (it just generates random numbers until 17 hits have occurred. However, I can't figure out how to add strategy, so when a hit is scored, the program will adjust to try and specify the spots around the hit and when it finds which direction the rest of the ship lies, it finishes off the ship. Any...
    See more | Go to post

  • telgroc
    started a topic Adding keys to a dictionary

    Adding keys to a dictionary

    I have a string stored in a text file. I need to read the string into python as a list of dictionaries. The format of data in the text file (called "input.txt" ) is as follows:
    <first name>,<last name>,<box number>,<house number>,<street >,<city>,<state >,<zipCode>,<GP A>

    Then there are multiple students, which are just added as one long line.
    The format that...
    See more | Go to post

  • telgroc
    started a topic Need help writing to a text file in Python

    Need help writing to a text file in Python

    I need to use a pre-existing list of strings in the format stated below. these strings need to be written to a text file called "input.txt"
    (so basically, there are 3 lines of data for each student and each of the fields is separated by a comma)

    <first name>,<middle name>,<last name>,<box number>
    <number>,<stree t>,<city>,<stat e>,<zip code>
    <gpa>...
    See more | Go to post
No activity results to display
Show More
Working...