REX ALAN YOUNG
REX ALAN YOUNG

Programming

I'm in the process of teaching myself a few coding languages, via an online course bundle I enrolled in during the pandemic for Oracle, Java and Python. It's still a work in progresss. I'm not bad at it, but still learning.

Here's an example of some code I wrote for fun...

Using what #javaprogramming I've learned thus far, I've written a program that rolls random 3d6 character traits for old-school #dungeonsanddragons #RPG. My studies continue, but this bit of code works fine:


public class ranChar {
public static void main(String[]args){
double str=(((Math.ceil(Math.random()*10))+(Math.ceil(Math.random()*10)))+(Math.ceil(Math.random()*10)))*(0.6);   
double con=(((Math.ceil(Math.random()*10))+(Math.ceil(Math.random()*10)))+(Math.ceil(Math.random()*10)))*(0.6); 
double dex=(((Math.ceil(Math.random()*10))+(Math.ceil(Math.random()*10)))+(Math.ceil(Math.random()*10)))*(0.6); 
double mnd=(((Math.ceil(Math.random()*10))+(Math.ceil(Math.random()*10)))+(Math.ceil(Math.random()*10)))*(0.6); 
double wis=(((Math.ceil(Math.random()*10))+(Math.ceil(Math.random()*10)))+(Math.ceil(Math.random()*10)))*(0.6); 
double cha=(((Math.ceil(Math.random()*10))+(Math.ceil(Math.random()*10)))+(Math.ceil(Math.random()*10)))*(0.6); 
System.out.println("Strength: "+(Math.ceil(str)));
System.out.println("Constitution: "+(Math.ceil(con)));
System.out.println("Dexterity: "+(Math.ceil(dex)));    
System.out.println("Intelligence: "+(Math.ceil(mnd)));     
System.out.println("Wisdom: "+(Math.ceil(wis)));    
System.out.println("Charisma: "+(Math.ceil(cha))); 
}}

 

Here's what the output looks like:

This Seattle Site:  Under Construction!

REX YOUNG
Greenwood / Bitter Lake / Northgate Area
Seattle, Washington

rex@rexyoung.com

Print | Sitemap
© REX YOUNG