[FORUM DOLLARS] Math questions!

Purchase/sell services for forum dollars or real cash (either goes). Forum dollar equivalent: $0.01 = 1 forum dollar
Forum rules
*Legendoflegaia.net is not responsible for any transactions that may go wrong UNLESS they're done in forum dollars and you can prove that the transaction has gone wrong. By having a service done with real money, you're on your own.
*If you're scammed in any way, name the scammer with proof of what they did in the scammer thread.
*Read the scammer thread before accepting or giving services from or to someone.
*If the good or service you're offering/requesting is in forum dollars, put [FORUM DOLLARS] in the topic title.
*If the good or service you're offering/requesting is in cash, put [CASH] in the topic title.
*If it's a service you're offering/requesting, please put in the topic title whether it's a request or offer.
*If the topic is regarding a "good" then put "need" or "selling" in the topic title.
User avatar
meth962
Level 23
Posts: 266
Joined: Tue Apr 03, 2012 8:37 am
Location: USA
Contact:

Re: [FORUM DOLLARS] Math questions!

Post by meth962 » Fri Aug 22, 2014 4:20 pm

Here's some C# code because.....why not!

Just set your "alphabet" of characters:

Code: Select all

string alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!$^&
The code sets the base to the length of characters.

Converting

Code: Select all

            decimal number = 0;

            for (int x = entry.Length-1; x > -1; x--)
            {
                number += (uint)(alphabet.IndexOf(entry[x])) * (decimal)Math.Pow(baseN, (entry.Length - x - 1));
            }

            return number.ToString("n0");
Decoding

Code: Select all

string sbase = string.Empty;

            int log = (int)Math.Log(number, baseN);

            while (log > -1)
            {
                ulong rem = (ulong)(number / Math.Pow(baseN, log));
                number -= rem * (ulong)Math.Pow(baseN, log);

                sbase = alphabet[(int)rem].ToString() + sbase;

                log--;
            }

            return sbase;
まさかつあがつ

User avatar
Redhollowlives999
Level Awesome.
Posts: 12139
Joined: Sun Jun 05, 2011 9:39 pm
Location: Yes
Contact:

Re: [FORUM DOLLARS] Math questions!

Post by Redhollowlives999 » Sun Aug 24, 2014 1:30 pm

i got one whats 2 + 2
it really do be like that tho

User avatar
meth962
Level 23
Posts: 266
Joined: Tue Apr 03, 2012 8:37 am
Location: USA
Contact:

Re: [FORUM DOLLARS] Math questions!

Post by meth962 » Sun Aug 24, 2014 2:11 pm

22? :)
まさかつあがつ

User avatar
Nightshade
Level 60
Posts: 1797
Joined: Tue Jul 26, 2011 9:07 pm
Location: the the the the

Re: [FORUM DOLLARS] Math questions!

Post by Nightshade » Sun Aug 24, 2014 2:16 pm

No, it's fish.
Do not question yourself with the why or the how. I simply am, and that is all you need to know.

User avatar
Redhollowlives999
Level Awesome.
Posts: 12139
Joined: Sun Jun 05, 2011 9:39 pm
Location: Yes
Contact:

Re: [FORUM DOLLARS] Math questions!

Post by Redhollowlives999 » Mon Aug 25, 2014 3:30 pm

DARN IT. Night got it again. >.>

You get 5 forum dollars.







HOW.








HOW?!
it really do be like that tho

User avatar
JCTC
Level 43
Posts: 917
Joined: Mon Apr 08, 2013 5:34 pm
Location: http://www.legendoflegaia.net/
Contact:

Re: [FORUM DOLLARS] Math questions!

Post by JCTC » Wed Oct 08, 2014 3:42 pm

O_O GENIUS
Names are for friends, so I don't need one.

~Agent 47

http://hitman.wikia.com/wiki/Agent_47

Post Reply