6 kyu

Next Version

968 of 2,088AzariasB

Description:

You're fed up about changing the version of your software manually. Instead, you will create a little script that will make it for you.

Exercice

Create a function nextVersion, that will take a string in parameter, and will return a string containing the next version number.

For example:

Current           ->  Next version
"1.2.3"           ->  "1.2.4"
"0.9.9"           ->  "1.0.0"
"1"               ->  "2"
"1.2.3.4.5.6.7.8" ->  "1.2.3.4.5.6.7.9"
"9.9"             ->  "10.0"

Rules

All numbers, except the first one, must be lower than 10: if there are, you have to set them to 0 and increment the next number in sequence.

You can assume all tests inputs to be valid.

Arrays
Strings
Algorithms

More By Author:

Check out these other kata created by AzariasB

Stats:

CreatedFeb 14, 2016
PublishedFeb 14, 2016
Warriors Trained3755
Total Skips105
Total Code Submissions14769
Total Times Completed2088
JavaScript Completions968
Python Completions797
Ruby Completions180
CoffeeScript Completions13
Haskell Completions31
TypeScript Completions99
Lua Completions79
Total Stars83
% of votes with a positive feedback rating94% of 383
Total "Very Satisfied" Votes342
Total "Somewhat Satisfied" Votes36
Total "Not Satisfied" Votes5
Ad
Contributors
  • AzariasB Avatar
  • matt c Avatar
  • imacg Avatar
  • 1b8 Avatar
  • chikamichi Avatar
  • pioraid Avatar
  • Voile Avatar
  • farhanaditya Avatar
Ad