|
I added that to my version last night.
And today I wondered about adding support for doing thousands as hundreds, e.g. "twenty-five hundred".
|
|
|
|
|
Thanks for a few days' exercise. I made one that can be used like:
2345L.ToString<ShortScale>() ==> Two Thousand Three Hundred Forty-Five
Where ShortScale is:
public enum ShortScale : long
{
Zero = 0 , One = 1 , Two = 2 , Three = 3 , Four = 4 , Five = 5 , Six = 6 , Seven = 7 , Eight = 8
, Nine = 9 , Ten = 10 , Eleven = 11 , Twelve = 12 , Thirteen = 13 , Fourteen = 14 , Fifteen = 15
, Sixteen = 16 , Seventeen = 17 , Eighteen = 18 , Nineteen = 19
, [PIEBALD.Types.NumNuts.HyphenatedAttribute] Twenty = 20
...
, [PIEBALD.Types.NumNuts.CountedAttribute] Hundred = 100
...
}
I also have an enum that will yield Twenty-Three Hundred Forty-Five , but it needs work.
Here's another:
2345L.ToString<Roman>() ==> MMCCCXLV
public enum Roman
{
Nulla = 0
, [PIEBALD.Types.NumNuts.RepeatedAttribute] I = 1
, [PIEBALD.Types.NumNuts.RepeatedAttribute] IV = 4
, [PIEBALD.Types.NumNuts.RepeatedAttribute] V = 5
, [PIEBALD.Types.NumNuts.RepeatedAttribute] IX = 9
, [PIEBALD.Types.NumNuts.RepeatedAttribute] X = 10
...
}
But this technique tops out at Quintillion (short scale) or Trillion (long scale), so another technique would be necessary to work with greater numbers.
It should be possible to define a class of BigInteger constants and use that instead.
Added:
public sealed class TestClass
{
public static readonly System.Numerics.BigInteger Zero = 0 ;
public static readonly System.Numerics.BigInteger One = 1 ;
...
[PIEBALD.Types.NumNuts.HyphenatedAttribute]
public static readonly System.Numerics.BigInteger Twenty = 20 ;
...
[PIEBALD.Types.NumNuts.CountedAttribute]
public static readonly System.Numerics.BigInteger Hundred = 100 ;
...
[PIEBALD.Types.NumNuts.CountedAttribute]
public static readonly System.Numerics.BigInteger Decillion = Thousand * Nonillion ;
...
}
modified 30-Sep-13 23:49pm.
|
|
|
|
|
That's really interesting... I completely didn't think about doing it like that...
|
|
|
|
|
|
|
Brilliant! That put a grin on my face this morning!
|
|
|
|
|
I'm thinking about starting an open project, and I've been looking for a site to write about it, to include code. I've noticed a lot of blogs don't deal well with code.
Would articles here be an acceptable way to share the project?
|
|
|
|
|
|
Well, I've been a fan of the Japanese flavor of Magjong for a while. It's a some that neatly combines luck and strategy.
The project I'm thinking of is making an app that will be playing the game.
I'll be using .Net (C#) as my language of choice. The overhead of .Net shouldn't be an issue for performance.
I'll start with the core of the game with a simple command-line interface, staying with that until the game can be played. From there, I'll work on the user interface to make the playing the game enjoyable.
I'm not sure if I'll go with a networked game or not.
There's a lot of things to cover, so there will be plenty of articles.
|
|
|
|
|
I wonder has anyone built a proper version of MahJong to be played on mobile/internweb with 4 players taking from the wall and building pung/kong and special hands. Seem mobile should lend itself to that.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
There are plenty of Japanese apps. I want to make one that I can play without a translator.
|
|
|
|
|
Are they the tile matching version or the pung/kong style?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The 4 -player kung/pong style. Tile matching has been done to death.
|
|
|
|
|
Thats going to be a challenge if it is not networked
If you need some collaboration let me know, I play for fun and the wife is competitive. I will also volunteer for beta testing if required
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks. I'll be starting slow, working thru the basics. It's going to be command line for a while.
It should be straightforward to have a hosted server an online games on top of the core of the game. I'm also intending on some game AI for bot players (and maybe having some fun with making them challenging).
|
|
|
|
|
Absolutely!
What's the project, if I may ask?
Marc
|
|
|
|
|
Yes!
The first step in the acquisition of wisdom is SILENCE, the second is LISTENING, the third MEMORY, the forth, PRACTICE and the fifth is TEACHING others!
|
|
|
|
|
Wait until you see the code and then decide.
|
|
|
|
|
CP used to have a Code Project's Projects Page. With enough interest, maybe Chris can bring it back.
|
|
|
|
|
Who can blame them for revolting. Clickety[^]
|
|
|
|
|
|
I get this movie is currently unavailable
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
It's playing okay for me right now.
|
|
|
|
|
It no likely Opera for some reason, put it into Firefox and it works.
Strange
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
ORACLE TEAM USA won the 34th America’s Cup with a 44-second victory over Emirates Team New Zealand in Race 19.
To summarise - the Mercans did shyte, drafted in a Brit, sunk the Kiwis.
Well played Sir Ben Ainslie, well played!
speramus in juniperus
|
|
|
|