I'm building an RPG Assistant app for various systems, and I've come up on a stumbling block in Commodore BASIC v7.0 when it comes to formatting the output for rolling percentile dice in the form of 2 d10 (high die, low die). I can't figure out how to format the output the way I want it without slowing the system to a crawl via nine extra IF/THEN statements. What I want to show are dice rolls of 01-00(printed as 100). What I get instead is 0 1-0 0(printed as 100). The workaround(not using nine extra IF/THEN) that I've found has the unwanted behavior of not displaying the high die if it equals zero.
rem d100 dim va$(2):rem string array for output x=0:rem high die y=0:rem low die x=int(rnd(0)*10):y=int(rnd(0)*10):rem rolling the dice va$(0)=str$(x):va$(1)=str$(y):rem putting the dice rolls into a string array for output vb$=str$((x*10)+y):rem workaround string if x=0 and y=0 then print 100:else print va$(0)(1):rem print vb$