Starfinder Playlist
  1. #1

    Stuck on algorithm using selective hexadecimal variables

    Hey all, hopefully there are a couple math wiz's out there that might be able to help me out because I am banging my head against a wall on this one... My problem is that I'm trying to create an algorithm that will calculate and then and apply a hexadecimal-assigned attribute based of off results of ten; when I say it like that it sounds manageable but I have no idea how to "write" that and can't seem to work it out beyond getting the results of ten...

    Specifically, I am really trying to make a simple automatic calculation and application of the result based on preexisting values (X+Y) with 16 unique results (I was thinking of defining each result as a hexadecimal variable 0-F).
    At the least, I know that I want "if (X+Y)>110 then... math.ceil(((X+Y)-110)/10)" and apply that to the hexadecimal variable progression but starting at the "5" instead of "0" of each new cycle. I know that I will specifically assign each result of (X+Y)<=110 0-F, it's on auto-calculation/assigning during repeat cycles that I feel like I'm having my block...
    And since the assigned 0-4 are "negative/neutral effect" values, on the "repeat cycles" I wanted to continue progression at the (hexadecimal) 15-1F, 25-2F, 35-3F, etc... instead of 10, 20, 30, etc... Would that work? I don't know if I'm making this unnecessarily complicated or not, I mean I know I could just define each likely result a strict value but I'd rather try and give a more interactive and dynamic approach so that large numbered results would be easier to find, also I feel like moving between the calculated result should be able to be done with an "X +/- #" to the assigned class (is "class" the right term to call the hexadecimal results and corresponding dice values?). I hope this isn't just coming off the ramblings of a mad-man that has been staring at the same problem for days...

    • 5 or Less, 0 = –1d8
    • 6–10, 1 = –1d6
    • 11–15, 2 = –1d4
    • 16–20, 3 = –1d2
    • 21–25, 4 = +0
    • 26–30, 5 = +1d2
    • 31–35, 6 = +1d4
    • 36–40, 7 = +1d6
    • 41–45, 8 = +1d8
    • 46–50, 9 = +1d10
    • 51–60, A = +1d12
    • 61–70, B = +2d6
    • 71–80, C = +1d8+1d6
    • 81–90, D = +2d8
    • 91–100, E = +1d10+1d8
    • 101-110, F = +2d10
    • 111-120 (math.ceil(((X+Y)-110)/10)=1), 15 = +2d10+1d2
    • 121-130 (math.ceil(((X+Y)-110)/10)=2), 16 = +2d10+1d4
    • 131-140 (math.ceil(((X+Y)-110)/10)=3), 17 = +2d10+1d6
    • 141-150 (math.ceil(((X+Y)-110)/10)=4), 18 = +2d10+1d8
    • 151-160 (math.ceil(((X+Y)-110)/10)=5), 19 = +3d10
    • 161-170 (math.ceil(((X+Y)-110)/10)=6), 1A = +2d10+1d12
    • 171-180 (math.ceil(((X+Y)-110)/10)=7), 1B = +2d10+2d6
    • 181-190 (math.ceil(((X+Y)-110)/10)=8), 1C = +2d10+1d8+1d6
    • 191-200 (math.ceil(((X+Y)-110)/10)=9), 1D = +2d10+2d8
    • 201-210 (math.ceil(((X+Y)-110)/10)=10), 1E = +3d10+1d8
    • 211-220 (math.ceil(((X+Y)-110)/10)=11), 1F = +4d10
    • 221-230 (math.ceil(((X+Y)-110)/10)=12), 25 = +4d10+1d2
    • 231-240 (math.ceil(((X+Y)-110)/10)=13), 26 = +4d10+1d4
    • Each 10 points, Continue Progression
    Last edited by trembot_89; May 21st, 2020 at 17:02.
    Jolly Cooperation.

  2. #2
    I was given a "push" at looking into iterators and pre-periods/periods as possible solutions to this problem, looks promising! Also nesting loops?
    Last edited by trembot_89; May 21st, 2020 at 20:49.
    Jolly Cooperation.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Fantasy Grounds Fridays Pre

Log in

Log in