Skip to main content
added 174 characters in body
Source Link
Nautilus
  • 221
  • 2
  • 4

Not ridiculously short like the others, but that's my first post:

JS, 279143 bytes

f=prompt("","");n=parseInt(f.match(/\d{1,}/));s=0;r=0;if(f.match(/B/)){r=(n+1)/2;s="Ft"+r;}if(f.match(/F/)){r=n*2-1;s="Bo"+r;}alert(f+" : "+s);

Ungolfed Version:

var f = prompt("", "");
var n = parseInt(f.match(/\d{1,}/));
var s = 0;
var r = 0;

if (f.match(/B/)) {
  r = (n + 1)/ 2;
  s = "Ft"+r;
 }
if (f.match(/F/)) {
  r = n * 2 - 1;
  s = "Bo"+r;
 }
alert(f+" : "+s);

Not ridiculously short like the others, but that's my first post:

JS, 279 bytes

var f = prompt("", "");
var n = parseInt(f.match(/\d{1,}/));
var s = 0;
var r = 0;

if (f.match(/B/)) {
  r = (n + 1)/ 2;
  s = "Ft"+r;
 }
if (f.match(/F/)) {
  r = n * 2 - 1;
  s = "Bo"+r;
 }
alert(f+" : "+s);

Not ridiculously short like the others, but that's my first post:

JS, 143 bytes

f=prompt("","");n=parseInt(f.match(/\d{1,}/));s=0;r=0;if(f.match(/B/)){r=(n+1)/2;s="Ft"+r;}if(f.match(/F/)){r=n*2-1;s="Bo"+r;}alert(f+" : "+s);

Ungolfed Version:

var f = prompt("", "");
var n = parseInt(f.match(/\d{1,}/));
var s = 0;
var r = 0;

if (f.match(/B/)) {
  r = (n + 1)/ 2;
  s = "Ft"+r;
 }
if (f.match(/F/)) {
  r = n * 2 - 1;
  s = "Bo"+r;
 }
alert(f+" : "+s);
Source Link
Nautilus
  • 221
  • 2
  • 4

Not ridiculously short like the others, but that's my first post:

JS, 279 bytes

var f = prompt("", "");
var n = parseInt(f.match(/\d{1,}/));
var s = 0;
var r = 0;

if (f.match(/B/)) {
  r = (n + 1)/ 2;
  s = "Ft"+r;
 }
if (f.match(/F/)) {
  r = n * 2 - 1;
  s = "Bo"+r;
 }
alert(f+" : "+s);