Skip to content

lacolle87/srfc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sim Racing Fuel Calculator

A simple and efficient CLI tool for sim racing enthusiasts to calculate total fuel, laps, and stints required for endurance racing. Designed to run in Linux terminals.


Features

  • Calculates total fuel consumption based on race duration and lap time.
  • Computes total laps and required stints.
  • Includes options for extra fuel margin.
  • Interactive mode for user-friendly input.
  • Lightweight and fast.

Installation

  1. Ensure you have Go installed on your system. You can check by running:

    go version

If not installed, follow the instructions at golang.org.

  1. Install the tool using go install:

    go install github.com/lacolle87/srfc@latest
  2. Make sure the Go bin directory is in your PATH:

    export PATH=$PATH:$(go env GOPATH)/bin

Usage

Basic Command

Run the tool with options:

srfc -lt <lap_time_in_seconds> -rl <race_length_in_minutes> -fc <fuel_consumption_per_lap> -tc <tank_capacity> -ef <extra_fuel_in_laps>

Example

srfc -lt 90 -rl 120 -fc 3.5

Output:

Total fuel: 420.00
Total laps: 80
Stints: 4

Interactive Mode

If you omit some or all flags, the program will prompt for input interactively:

racer-calculator

Example prompts:

Enter lap time (in seconds): 90
Enter race length (in minutes): 120
Enter fuel consumption per lap: 3.5
Enter fuel tank capacity: 110
Enter extra fuel needed in laps: 2

Options

  • -lt: Lap time in seconds (e.g., 90)
  • -rl: Race length in minutes (e.g., 120)
  • -fc: Fuel consumption per lap (e.g., 3.5)
  • -tc: Fuel tank capacity (default: 110)
  • -ef: Extra fuel needed in laps (default: 2)
  • -h: Show help message

Help

Display usage instructions:

racer-calculator -h

Requirements

  • Go 1.23 or newer
  • Linux-based operating system

Contributing

Feel free to fork this repository and submit pull requests with enhancements, bug fixes, or additional features.


License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A simple and efficient CLI tool for sim racing enthusiasts to calculate total fuel, laps, and stints required for endurance racing. Designed to run in Linux terminals.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages