 | | Lusus Naturę
Posts: 5,940
Gallery:
0
Comments: 0
Join Date: Dec 2001 Location: NJ, US Zodiac Sign:
Pisces
| Re-learning how to program -
03-17-04
What programming language would you suggest I start with? I'm rather adept at developing algorithms, just don't know any programming languages. Bismarck once said "Fools say they like to learn from their experiences, but I prefer to learn from the experience of others."
"Move that one of your pieces, which is in the worst plight, unless you can satisfy yourself that you can derive immediate advantage by an attack." -Adolph Anderssen To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| |
| | | -= Grey CyberAngel =-
Posts: 4,826
Gallery:
0
Comments: 0
Join Date: Oct 2001 Location: 41:65:74:65:72:6E:75:73 => 58:65:78:71:82:89:58:00 <= Zodiac Sign:
Taurus
|
03-17-04
Pascal is easy to learn concepts with, and basic programming syntax. But most people these days use C++ or one of the similar languages (Java, C# ect). ... Time has no bearing... ...when the whiteout begins...
Don't come after me... | | |
| | | Lusus Naturę
Posts: 5,940
Gallery:
0
Comments: 0
Join Date: Dec 2001 Location: NJ, US Zodiac Sign:
Pisces
|
03-18-04
Well, I've been fooling around with java, and an error I can't seem to figure out. My classes Modular and NegaModular both operate x mod y, and output an double number. How can I take this number and operate it with other double numbers?
i.e.:
public double BaseAdd(double x,double y,double z){
double a=0;
double b=0;
double c=0;
double d=0;
double e=0;
double f=0;
double h=0;
while (x>0 | y>0) {
Modular k = new Modular(x,10);
Modular m = new Modular(y,10);
a = x-k;
b = y-z;
c = k+z;
if(c>z){
Modular g = new Modular (c,z);
h = c-g;
c = g;
d = (10^e)*c+d;
e = e+1;
}
return d;
}
}
}
(my method, btw)
When I compile, I get the errors:
BaseAdd.java:20: operator - cannot be applied to double,Modular
a = x-k;
^
And the 4 other operations (c=k+z; h = c-g; c = g;, and 10^e) Bismarck once said "Fools say they like to learn from their experiences, but I prefer to learn from the experience of others."
"Move that one of your pieces, which is in the worst plight, unless you can satisfy yourself that you can derive immediate advantage by an attack." -Adolph Anderssen To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| |
| | | Lusus Naturę
Posts: 5,940
Gallery:
0
Comments: 0
Join Date: Dec 2001 Location: NJ, US Zodiac Sign:
Pisces
|
03-18-04
How can I ensure the Modular object is a double object when returned? Bismarck once said "Fools say they like to learn from their experiences, but I prefer to learn from the experience of others."
"Move that one of your pieces, which is in the worst plight, unless you can satisfy yourself that you can derive immediate advantage by an attack." -Adolph Anderssen To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| |
| | | -= Grey CyberAngel =-
Posts: 4,826
Gallery:
0
Comments: 0
Join Date: Oct 2001 Location: 41:65:74:65:72:6E:75:73 => 58:65:78:71:82:89:58:00 <= Zodiac Sign:
Taurus
|
03-19-04
I don't know the Modular object... But I would suspect something like modular.value would be the syntax. ... Time has no bearing... ...when the whiteout begins...
Don't come after me... | | |
| | | Lusus Naturę
Posts: 5,940
Gallery:
0
Comments: 0
Join Date: Dec 2001 Location: NJ, US Zodiac Sign:
Pisces
|
03-25-04
I wrote the Modular class, which works perfectly. What's the syntax to make sure that when the Modular method runs, it returns the Modular object as a double object instead? Bismarck once said "Fools say they like to learn from their experiences, but I prefer to learn from the experience of others."
"Move that one of your pieces, which is in the worst plight, unless you can satisfy yourself that you can derive immediate advantage by an attack." -Adolph Anderssen To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| |
| | | -= Grey CyberAngel =-
Posts: 4,826
Gallery:
0
Comments: 0
Join Date: Oct 2001 Location: 41:65:74:65:72:6E:75:73 => 58:65:78:71:82:89:58:00 <= Zodiac Sign:
Taurus
|
03-26-04
return (double)d ... Time has no bearing... ...when the whiteout begins...
Don't come after me... | | |
| | | Lusus Naturę
Posts: 5,940
Gallery:
0
Comments: 0
Join Date: Dec 2001 Location: NJ, US Zodiac Sign:
Pisces
|
03-26-04
ooer, trying that out now. Bismarck once said "Fools say they like to learn from their experiences, but I prefer to learn from the experience of others."
"Move that one of your pieces, which is in the worst plight, unless you can satisfy yourself that you can derive immediate advantage by an attack." -Adolph Anderssen To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| |
| | | Lusus Naturę
Posts: 5,940
Gallery:
0
Comments: 0
Join Date: Dec 2001 Location: NJ, US Zodiac Sign:
Pisces
|
03-26-04
Ouch, 34 errors.
I'm not in the mood for this now, maybe later. Bismarck once said "Fools say they like to learn from their experiences, but I prefer to learn from the experience of others."
"Move that one of your pieces, which is in the worst plight, unless you can satisfy yourself that you can derive immediate advantage by an attack." -Adolph Anderssen To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| |
| | | Lusus Naturę
Posts: 5,940
Gallery:
0
Comments: 0
Join Date: Dec 2001 Location: NJ, US Zodiac Sign:
Pisces
|
03-26-04
Btw, here's my classes so far. The top class has 34 errors, the bottom is perfect (but is used in the top).
__________________________________________________
/** Converts from Base 10 to Base -2 */
public class Base10ConvertNega2 {
public static void main(String[] args) {
int input = Integer.parseInt(args[0]);
double x = BaseConvertNegax(input);
System.out.println(a);
System.out.println(b);
System.out.println(k);
}
public double Base10ConvertNega2(double x){
double a=0;
double b=0;
double c=0;
double d=0;
double k=0;
double z=0;
while (x>0) {
Modular k = new Modular(x,2);
x=x-k;
Modular d = new Modular(z,2);
if (d=0){
k=k-c;
a=k*(10^z)+a;
z=z+1;
c=0;
}
if (d=1){
c=c+k;
k=10-k;
a=k*(10^z)+a;
}
return a;
}
double b=0;
double c=0;
double d=0;
double k=0;
double z=0;
while (x>0) {
Modular k = new Modular(x,2);
x=x-k;
Modular d = new Modular(z,2);
if (d=1){
k=k-c;
b=k*(10^z)+b;
z=z+1;
c=0;
}
}
if (d=0){
c=c+k;
k=10-k;
b=k*(10^z)+b;}
return b;
}
Baseadd k = new Baseadd(a,b,2);
}
______________________________________________
/** Performs x mod(y) */
public class Modular {
public double x,y;
public Modular(double x,double y){
this.x=x; this.y=y;
}
public double Modular(double x,double y){
while (x>y){
x=x-y;
}
return (double)x;
}
} Bismarck once said "Fools say they like to learn from their experiences, but I prefer to learn from the experience of others."
"Move that one of your pieces, which is in the worst plight, unless you can satisfy yourself that you can derive immediate advantage by an attack." -Adolph Anderssen To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| |
| |  | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| | | |
Similar Threads | | Thread | Thread Starter | Forum | Replies | Last Post | | Federal Role In Education | Dyshade | Serious Discussion | 43 | 03-17-04 22:21 | | | Latest Threads | | | | | | | | | | | | | | | | | | | | | Galleries | | |