• Welcome to the new COTI server. We've moved the Citizens to a new server. Please let us know in the COTI Website issue forum if you find any problems.
  • We, the systems administration staff, apologize for this unexpected outage of the boards. We have resolved the root cause of the problem and there should be no further disruptions.

UWP Decoders

creativehum

SOC-14 1K
I had a couple of terrific UWP Decoders bookmarked...
And now they seem to be gone.

I ask this with gratitude toward the folks who have built these things:
Have they been moved?
Are there any new ones available?

Thanks!
 
GURPS style paragraph... or even lines breaking down each code into its appropriate translation.

I have to admit, after translating a dozen of them, my eyes get a bit dizzy.
 
GURPS style paragraph... or even lines breaking down each code into its appropriate translation.

I have to admit, after translating a dozen of them, my eyes get a bit dizzy.

I'm working on one...
it's not hard, just slow...
 
Well, thanks ahead of time, and I hope it goals well.

That said, there is something about doing it slowly (as i was just doing it earlier), adding each world's detail piece by piece, and being surprised by what kind of setting one begins to imagine.
 
Well, thanks ahead of time, and I hope it goals well.

That said, there is something about doing it slowly (as i was just doing it earlier), adding each world's detail piece by piece, and being surprised by what kind of setting one begins to imagine.

I'll have a VERY basic UWP to paragraph up shortly. I'm through population...

It's all just nested switch/case statements with some string pushing. Easy (but slow to write due to massive typing). Taking a break.

TPPG will wait for another day.

COTI will happily host a better one, if someone writes one.
 

Nice!

Quick tips:

* Sanitize the inputs rather than having multiple cases, e.g. String(x).toUpperCase()
* Consider using object literals for lookups rather than switch/case, e.g.:

Code:
var STARPORT_TABLE = {
 A: 'Awesomesauce',
 B: 'Would recommend',
 C: 'The diner is okay',
 D: 'In a pinch'
 E: 'Anyone home?',
 X: 'Never leave the ship'
};
var msg = STARPORT_TABLE[String(uwp)[0].toUpperCase()] || '?????';

Apologies if unwanted; I spend a significant chunk of time each day reviewing other people's code. Can't... stop... it...
 
And Wil, if you want it, you can have my JS which figures out the trade codes.

<Attached>

I'll see if it integrates easily.

@Tash - I honestly prefer the extra case statements - yes, it's less processor efficient, but it's also able to handle other issues. It's not like we're running this on a Z-80. And, technically, "x" is different from "X" for government (even tho' i've not coded it as such), based upon T4. Wherein "X" is a droyne hierarchy, and "x" is "code not generated"

Case isn't terribly inefficient, anyway.
 
Efficiency is not the issue - it's code maintainability. And if it's code you never expect anyone else to read, knock yourself out. :)
 
spotted a bug in the code for that UWP decoder- if the third number is a 5, and the 4th number(pop) is also a 5, the it makes pop 0. if you put in a series of 5's, then it shows as 555000

the issue is with the UWP output, but not the 'paragraphs' that relate to the original input. also if you put a - before the tech level, it ignores it. so c556555a would work, but c555555-a would have problems.
 
Efficiency is not the issue - it's code maintainability. And if it's code you never expect anyone else to read, knock yourself out. :)
In terms of maintainability, it's no different, and one less place for errors to be masked by external functions...
 
spotted a bug in the code for that UWP decoder- if the third number is a 5, and the 4th number(pop) is also a 5, the it makes pop 0. if you put in a series of 5's, then it shows as 555000

the issue is with the UWP output, but not the 'paragraphs' that relate to the original input. also if you put a - before the tech level, it ignores it. so c556555a would work, but c555555-a would have problems.
Bug fixed. was a failure on my part to correct the comparisons after copy-paste.

Robject: I don't understand your code's syntax... Apparently your level of .js is higher than mine.
 
Back
Top