Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7652921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:53:39+00:00 2026-05-31T11:53:39+00:00

I am using Robocode to develop GA tanks that evolve to give better performance

  • 0

I am using Robocode to develop GA tanks that evolve to give better performance (achieving highest fitness levels) and in order to do that I need to store information about each tank in one file.

The class Tank will have several variables such as:

  • Speed
  • Angular Momentum
  • Fire power
  • Scan Rate

I would like a way to be able to save these variables in a file called “settings.txt” and to be able to update them after a battle.

I would like the file to be formatted like:

robot(1):
speed=12
angMomentum=6
firePower=2
scanRate=10

robot(2):
speed=8
angMomentum=4
firePower=3
scanRate=13

What would be the best way to write a file like this and to be able to easily update the variable values after each battle?

Many Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T11:53:40+00:00Added an answer on May 31, 2026 at 11:53 am

    If you want all your data in one big file. Maybe it’s a good idea to use something like a JSON format because you can maintain your object structure. Use variables, objects and arrays.

    There are lots of JSON readers and writers available. Even some ‘official’ bij json.org to be found here

    Your JSON could look like this:

    {
        "tanks":[
            {"id": 1, "speed": 12, "angMomentum": 6, "firePower": 2, "scanRate": 10},
            {"id": 2, "speed": 8, "angMomentum": 4, "firePower": 3, "scanRate": 13}
        ]
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using C#, I need a class called User that has a username, password, active
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
using a binary search tree I need to add to a vector all int
Using report builder 3.0, I have a report that queries a cube. How do
Using Entity Framework CodeFirst, how do I create a created datetime column that gets
Using gcc and ld on x86_64 linux I need to link against a newer
Using CRM 4, I have an entity form that contains a tab with an
using VB.Net2010 I need to call a C# DLL The problem I have is
I'm working on a game (C#) that uses a Robocode-like programming model: participants inherit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.