|
TIGCC
Jan 8, 2005 20:02:48 GMT -5
Post by bfr on Jan 8, 2005 20:02:48 GMT -5
I checked mine about 20 minutes ago. nothingnew (I think, necause I ddn't check very good)
|
|
|
TIGCC
Jan 8, 2005 20:07:13 GMT -5
Post by Vladik on Jan 8, 2005 20:07:13 GMT -5
You won't always have new PMs; you can check it once per day.
|
|
|
TIGCC
Jan 9, 2005 17:24:57 GMT -5
Post by bfr on Jan 9, 2005 17:24:57 GMT -5
Now back to Calc c...how are its commands similar/different than BASIC commands? Does it just allow more options for each complicated? Is it like a slightly upgraded BASIC with fast speed?
|
|
|
TIGCC
Jan 9, 2005 17:57:22 GMT -5
Post by bcherry on Jan 9, 2005 17:57:22 GMT -5
Haha, funny question. It is entirely different than BASIC. It merely uses the same names. For example, in BASIC you could do this:
: 1->T : For X,1,10 : T*X->T : End : Disp T
What did I just do? That was a factorial. I multiplied together all the numbers from 1 to 10 and printed the result. 10! right? Here is that in C:
long t = 1; int x; for (x = 1; x <=10; x++) { t = t * x; } printf("%lu", t);
That's not too different. Notice the For loop is different though a little bit. The "=" is roughly the same as "->" in BASIC. Be careful though, because "=" in BASIC is the same as "==" in C. That bit of code up there tells it there is a number (long means really big number) t and a number x. T is 1 to start. Then it loops from when x is until x is no longer less than or equal to 10, incrementing once each time. In each loop, it multiplies t by x and stores it to t. Then it prints t. This accomplishes the same thing: (in C)
long t = 1; int x = 1; for (;x <= 10; t*=x++); printf("%lu", t);
But that didnt make any sense did it? That last one was just me being purposefully cryptic to emphasize how flexible C is. How about this:
long t = 1, x = 1; while (x <= 10) {t*=x; x++;} printf("%lu", t);
Or how about:
printf("%lu", factorial(10));
...
long factorial(long num) { return num * factorial(num - 1); }
All of those do the exact same thing. Only one of them was like BASIC. I just felt like giving a long drawn out answer.
|
|
|
TIGCC
Jan 9, 2005 19:57:45 GMT -5
Post by Vladik on Jan 9, 2005 19:57:45 GMT -5
The fourth one was slightly similar to BASIC...
|
|
|
TIGCC
Jan 9, 2005 20:26:44 GMT -5
Post by bcherry on Jan 9, 2005 20:26:44 GMT -5
How? it was a recursive function. Well ok, that might be possible in BASIC, but barely. Or by 4th do you mean the while one, in which case, yes but I forgot I wrote that one.
|
|
|
TIGCC
Jan 9, 2005 20:28:04 GMT -5
Post by bfr on Jan 9, 2005 20:28:04 GMT -5
Wha tdoes "long" mean in c?
|
|
|
TIGCC
Jan 9, 2005 20:29:22 GMT -5
Post by Vladik on Jan 9, 2005 20:29:22 GMT -5
It would be possible if the number whose factorial was taken was less that 37...
I have noticed that you can have a maximum of 38 nested programs.
|
|
|
TIGCC
Jan 9, 2005 20:40:32 GMT -5
Post by bcherry on Jan 9, 2005 20:40:32 GMT -5
One of the differences in C is that you need to specify what type your variable is. You can then name it anything. So I could make an integer called bfrs_age like this:
int bfrs_age = 12;
However, integers are only 16 bits in memory, meaning that they are a 16 digit binary number. However, the biggest 16 digit binary number is 65535, meaning an integer can only be as big as 65535, then it stops working. Plus, an integer also could be + or -, and one of the 16 bits is reserved for that, so really it could only be from -32767 to +32767. If you wanted it to go up to 65535, youd have to make it unsigned, and it would no longer be able to be negative. Regardless, 10! is 3628800, far too big for an integer. So I made it a type "long". Long numbers are 32 bits, meaning that they can hold much bigger numbers. A regular long can be between -2147483648 and 2147483647, and unsigned they can be up to 4294967295. The other primitive number type is "char", which is 8 bits, or as big as 255 (char is always unsigned).
|
|
|
TIGCC
Jan 9, 2005 21:59:00 GMT -5
Post by Vladik on Jan 9, 2005 21:59:00 GMT -5
I wish that there were eXtraLONG (xlong) numbers; numbers that could have a lot of digits. (as in Exact mode on a calculator; you can do accurate arithmetic with 100-digit-long numbers)
|
|
|
TIGCC
Jan 9, 2005 22:12:04 GMT -5
Post by bcherry on Jan 9, 2005 22:12:04 GMT -5
I know that with Java or C++ there are classes for stuff like that. In C, you're pretty much stuck with long...
|
|
|
TIGCC
Jan 9, 2005 22:12:44 GMT -5
Post by Vladik on Jan 9, 2005 22:12:44 GMT -5
Sad, huh?
|
|
|
TIGCC
Jan 9, 2005 22:15:04 GMT -5
Post by bcherry on Jan 9, 2005 22:15:04 GMT -5
Kind of, but i cant think of many applications for that many digits of precision anyways.
|
|
|
TIGCC
Jan 9, 2005 22:19:31 GMT -5
Post by Vladik on Jan 9, 2005 22:19:31 GMT -5
...Serious Compression?
|
|
|
TIGCC
Jan 23, 2005 19:47:12 GMT -5
Post by Simon on Jan 23, 2005 19:47:12 GMT -5
thats a hard language tho
|
|
|
TIGCC
Jan 23, 2005 19:52:49 GMT -5
Post by bfr on Jan 23, 2005 19:52:49 GMT -5
lisp language is hard, but efficient. I think it was used to program some kinds of robots/digital devices.
|
|
|
TIGCC
Jan 23, 2005 20:23:25 GMT -5
Post by Simon on Jan 23, 2005 20:23:25 GMT -5
how much time do you need if you whant to be good, 2 month?... 6 month ?
|
|
|
TIGCC
Jan 24, 2005 1:55:40 GMT -5
Post by bcherry on Jan 24, 2005 1:55:40 GMT -5
In C? I started doing TIGCC last september, and in January I made this, so it really doesnt take too long. Mostly you just have to be able to think about it right, and have a natural disposition towards computer logic.
|
|
|
TIGCC
Jan 24, 2005 18:17:06 GMT -5
Post by Vladik on Jan 24, 2005 18:17:06 GMT -5
If you're really good at BASIC, there is a good chance that you will be pretty good at C...
|
|
|
TIGCC
Jan 24, 2005 20:51:46 GMT -5
Post by Simon on Jan 24, 2005 20:51:46 GMT -5
I am not good in basic i leaned fast tho
|
|