C#... Oh, OK. So you're on Windows .NET framework. That is enough to get started. What trouble have you had with C++? Best to start practicing C++ as simple as possible, I think. Maybe, for example g++ , the GNU C++ compiler for Windows, and then collect a few C++ source codes examples from the web to compile for practice.
Filename: practice.cpp
#include <iostream>
using namespace std;
int main()
{
cout << "Practice makes perfect.\n";
}
Compiles with:
C:\> g++ practice.cpp -o practice.exe
Or, you can have both in your programming arsenal.
C# is suited for web development with ASP.NET.
C++ is unmanaged source code, so it's good to know.
Filename: practiceIO.cpp
#include <string>
#include <iostream>
using namespace std;
int main ()
{
string YN, A="offline", N;
int i;
cout << "\n\n";
cout << "Are you online, yes or no? ";
getline (cin, YN);
string response[4];
response[0] = "Yes";
response[1] = "yes";
response[2] = "Y";
response[3] = "y";
for(i = 0; i < 4; i++){
if(response[i] == YN){
A="online";
break;
}
}
cout << "You're " << A << ".\n" << "What's your name? ";
getline (cin, N);
cout << "So, " << N << ", you're " << A << ".\n\n";
return 0;
}
Compiles with:
C:\> g++ practiceIO.cpp -o practiceIO.exe
Program Output:
Are you online, yes or no? no
You're offline.
What's your name? Bob
So, Bob, you're offline.
Are you online, yes or no? yes
You're online.
What's your name? April
So, April, you're online.
___________________________________________________________________________
That's very informative, thank you.
Hmm, on second thought, a graphical interface for 0D system is probably crucial. I realized as I kept planning on the 0D Phase 1. Hmm...
Well, for appropriate design, I mentioned from my previous mocking thread that my AI is based on mesh system with a bit of hierarchical composition-- somewhat similar to full brain simulation-- except mine is spatial. As you probably know that human brain is made up of different parts, and those parts each functioned differently. Thus my project requires a lot of Custom Classes, or Custom Structs (In C#, classes are reference types, and structs are value types). Each classes stores different things, and even different way.
Many or most data must not be duplicated. Since I need to make sure that the memory and the processing must be as optimized as it can be, so most larger data like neurons must be referenced. Our human brain revolves through plasticity. My model of AI follows that, of course. Thus, more neural connection is formed rather than new neurons -- that sort of thing.
So, yeah, data flowing through neurons. Lots and lots of neurons... Our brain is like a recorder, constantly recording every possible events, while forgetting. I'm not entirely convinced if C++ can handle that. I'm not much experienced in these IT fields, once again, wewewew. (Although my AI doesn't really need the entire brain to just say "hi". So, it doesn't effect much even if there's a million of synapses, for a reason.)
However, my project... Requires 2 AI to work at once -- sort of. So, two brains. Wewew. I don't think anyone has ever thought of 2 AI at once before, have they? ...
I heard that C++ are prone to memory problems, like memory leaks? While C# has garbage collection -- but I am not sure. I have no idea how to work with C++ memory pointers and stuff, for sure. They've never cease to confuse me.
Edit: And I need fastest matching data-- dictionary and hash works. My AI does not involve sorting at all.
So, it's not just simply...
switch (input.ToUpper())
{
case "BLARGH": return "What?";
case "BLORGH": return "Stop it."
case "BLERGH": return "I said, stop it!"
case "BLURGH": return "One last time... Stop it."
case "BLIRGH": return "... ... ..."
case "BLYRGH": return "GOD DAMNIT YOU LITTLE! --"
}
kei10 posted a code snippet, which may be useful under certain circumstances.
A small special purpose robot would do well with this code technique. For example,
it would fit on a small IC (integrated circuit) chip, very nicely.
switch (input.ToUpper())
{
case "BLARGH": return "What?";
case "BLORGH": return "Stop it."
case "BLERGH": return "I said, stop it!"
case "BLURGH": return "One last time... Stop it."
case "BLIRGH": return "... ... ..."
case "BLYRGH": return "GOD DAMNIT YOU LITTLE! --"
}
However, as the robot expands, this code snippet, raises a question...
What if your input is "BLARGH BLORGH BLERGH BLURGH BLIRGH BLYRGH",
repeated eight times in a row? The answer is... It would respond with the same response, "What?" eight times in a row.
Yet, there are several other matches, the A.I. could use to produce multiple responses
to choose from: "Stop it.", "I said, stop it!", "One last time... Stop it.", "... ... ...",
"GOSH DARNIT YOU LITTLE!". Giving the A.I. access to multiple responses would make it a more convincing simulation of intelligence.
Would you like to discuss this technique further?
"It's illegible!" Anonymous exclaimed. Yet, Kei simply posted the scribble upsidedown, as a primitive form of cipher, I prefer to think. Leonardo da Vinci used mirror writing.
#include "stdio.h"
#define BLARGH 6952064634741 // "What?"
#define BLORGH 6952065137859 // "Stop it."
#define BLERGH 6952064778489 // "I said, stop it!"
#define BLURGH 6952065353481 // "One last time... Stop it."
const char *response[] = {
"What?",
"Stop it.",
"I said, stop it!",
"One last time... Stop it."};
const unsigned long hash(const char *str) {
unsigned long hash = 5381;
int c;
while ((c = *str++))
hash = ((hash << 5) + hash) + c;
return hash;
}
int main() {
char *stimulus = "BLURGH";
switch(hash(stimulus)) {
case BLARGH:
printf("Response:%lu is: %s...\n",hash("BLARGH"), response[0]);
break;
case BLORGH:
printf("Response:%lu is: %s...\n",hash("BLORGH"), response[1]);
break;
case BLERGH:
printf("Response:%lu is: %s...\n",hash("BLERGH"), response[2]);
break;
case BLURGH:
printf("Response:%lu is: %s...\n",hash("BLURGH"), response[3]);
break;
default:
printf("Command '%s' is not found.\n", stimulus);
}
}
Pure C Language source code, which demonstrates a hash function. Please ask about this example, if you may find it to be curious. Join our discussion. We're all friends here.
Program Output:
Response:6952065353481 is: One last time... Stop it....
The suggestions? Yeah! ;D
As for have I am back on track yet -- Not quite, thank you for the heads up, korrelan. O0
I'm still gathering information randomly, mostly resting and relaxing from my dry eyes, which are going to detonate one day. Hours and hours of daydreaming in a harsh blabbery world, to cope with my anxiety. Although the harshness of that world made it worse, so I have to keep going until I end up somewhere more peaceful. :idiot2:
As for what I recently thought about how information is conveyed to be applied to a topological space -- Chaining elements together is a must, and that's the 2nd level beside the lowest 1st level which is the sole Elements. Anymore chains will become hierarchical information which is the 3rd level. The final 4th level information forms mesh or graphical information, like the Chemical Structure illustration, arts, geometry, and all that.
Now I am rather stuck on how to store these chains of information, and evaluate them with best efficiency. Since atomic structures are capable of forming up to the max 4th level.
In a Water molecule, there are a pair of hydrogen atoms, and an oxygen atom. What bounds them together is the electron. Given that, we can say there are two chains.
(https://aidreams.co.uk/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FsQxUTmQ.png&hash=22d41cbf400322d0f8c86e38c81fc84706c1f363)
So far, I've only thought of two ways to store these chains.
define object Element()
self.ListOfChains = new List()
The example above shows that the Element themselves will store the chain reference. There are two ways to store these chains; Bias (one-way), or two-way, which means two Elements that bound together must have the chain reference stored within the ListOfChains collection of each other.
define function Element.Bind(this Element e1, Element e2)
e1.ListOfChains.Add(e2)
e2.ListOfChains.Add(e1)
define function Element.BindBias(this Element e1, Element e2)
e1.ListOfChains.Add(e2)
elementA = new Element()
elementB = new Element()
elementA.Bind(elementB)
//elementA.BindBias(elementB)
Let's begin by taking a look at One-way chains.
I've been headaching with the problem of Order of Evaluation. Which means, where should the system start evaluating the structure? Begin from Hydrogen, or Oxygen?
(https://aidreams.co.uk/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2F7eM5zxp.png&hash=a12771464c9abbdccd64226ce111eb9f1eb3a871)
Given the structure above, we have element A to H. Each are connected by binds respectively from t to z. If we randomly chooses order of evaluation, the result of the evaluation becomes different if the biased bonding is different -- only if the evaluation must be ordered.
Set returned if the structure's connection is biased from origin A = {A, B, C, D, E}, {E, F}, {E, G}, {E, H}
Set returned if from E = {E, D, C, B, A}, {E, F}, {E, G}, {E, H}
Set returned if from G = {G, E}, {E, F}, {E, H}, {E, D, C, B, A}
If the evaluation excludes ordering, the result for any order will become identical, as {E, D, C, B, A} is same as {A, B, C, D, E}.
Alright, now let's take a look at Two-Way chains.
This idea of storing the chain data raises a problem; Circular chaining.
(https://aidreams.co.uk/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FiO3QkbC.png&hash=0854b5cf6004bf2a79831729b844a000161e5ae4)
From the image, given that it is easy for the system to ignore previous evaluated Element by one chain, we can see that no matter which order we start, there will always 3rd party chain that leads back to an Element that is already evaluated, which it will goes in circle. As the evaluation hits an intersection, it will split, thus increasing the number of evaluation until the system freezes and crashes.
We can fix that by creating another hash collection to check if the Element has been evaluated.
That being said, there is another way to store the chains independently, is that we can define another object that only connects two Elements together, we'll call it Binder. This binder thingie is like the Electron.
define object Element()
pass
define object Biased(Element e1, Element E2)
self.BindedElementA = e1
self.BindedElementB = e2
elementA = new Element()
elementB = new Element()
bindAB = new Binder(elementA, elementB)
Now I wonder how do I even evaluate something like this, given that we have two collections to store the two types of objects within a Quasi-Enveloped space. One is to store the existing Elements, and another is to store existing Binders...
(https://aidreams.co.uk/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2F7eM5zxp.png&hash=a12771464c9abbdccd64226ce111eb9f1eb3a871)
Since the Element does not store any chain data, there is no point evaluating the Elements -- or we have to evaluate it once for certain reasons. Whilst to evaluate the structure, we can do it by evaluating the chains collection.
Set returned by evaluating the Elements collection = {A, B, C, D, E, F, G, H}
Set returned by evaluating the chains collection = {A, B}, {B, C}, {C, D}, {D, E}, {E, F}, {E, G}, {E, H}
But then I'm even more stuck on another particular thing -- What am I doing? This is a blind approach that I can't really tell where I am going with this. While I've designed these stuff, I can't find out what am I supposed to use it for.
Well I can become a chemist by blindly testing the aspects and properties.
But still, the purpose of Chemical Reaction, or what I named this as "Chain Reaction Properties", since reaction alters the properties of things.
But once again, I am not creative... What kind of properties I can add? Well, I can begin with Energy -- and, that's it.
Presented with so many options and bombarded by cognitive dissonance -- I am not creative enough... :'(