Jump to content
The Dark Mod Forums

Quick C++ Question & Language Discussion


demagogue

Recommended Posts

Ok, so I wrote a little program in C++ to construct nonsense words according to simple statistical properties (the length of the word & likelihood of letters appearing). Really simple thing. So I wrote it for some interpreter (I forget the name now), using the exact code I got from a C++ textbook, and it worked just fine for that. But now on a new computer, it's like 2 GB to install it. And since I was using MS Visual C++ for Dark Mod stuff anyway, it's a smaller install, & I'd rather just use that, the 2010 version if it matters. (Is Dark Mod still using the 2006 version, or the 2010 version now?)

 

So if I try to run it directly on VC++, it doesn't understand any of the #include and #pragma stuff, so the basic stuff like cin and cout, strings, and the random function, basically any of the functions I'm using, aren't recognized. Also I'm not able to write stuff to a file or get output.

 

My basic question is, what do I need to change or do to get it running on VC++. I'm really newbie when it comes to programming, so feel free to talk to me like a 4 year old. I'm imagining it's just a really simple thing I need to do, so I thought it best just to ask.

 

 

//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <tchar.h>
#include <iostream.h>
#include <fstream>
using namespace std;
using std::cout; // program uses cout
using std::cin;  // program uses cin
using std::endl; // program uses endl
#include <cstdlib> // contains function prototype for rand
using std::rand;
#include <string>
using std::string;

//---------------------------------------------------------------------------
#pragma argsused
int _tmain()
{
int wordType;
bool doitagain = TRUE;
bool firstletter = FALSE;
int i,j, k;
int counter, counter2;
string letter;
ofstream File("File.txt");
string verb[4];
string noun[20];
string glyph[200];


while( doitagain )
{
  cout << "Write 100: 1. Verbs. 2. Nouns. 3. Glyph Codes 4. Quit\n";
  cin >> wordType;
  if (wordType == 1)
  {
 cout << "Verb.\n";
 for ( int counter = 1; counter <= 100; counter++ )
 {
   for ( int counter2 = 1; counter2 <= 4; counter2++ )
   {
	i = 1 + rand() % 100;
	if ( i < 13 )
	 letter = 'N';
	else if ( i < 18 )
	 letter = 'M';
	else if ( i < 24 )
	 letter = 'P';
	else if ( i < 28 )
	 letter = 'B';
	else if ( i < 32 )
	 letter = 'T';
	else if ( i < 35 )
	 letter = 'K';
	else if ( i < 44 )
	 letter = 'C';
	else if ( i < 49 )
	 letter = 'F';
	else if ( i < 61 )
	 letter = 'S';
	else if ( i < 67 )
	 letter = 'R';
	else if ( i < 75 )
	 letter = 'X';
	else if ( i < 85 )
	 letter = 'H';
	else if ( i < 90 )
	 letter = 'L';
	else if ( i < 95 )
	 letter = 'Y';
	else
	 letter = 'W';
	cout << letter;
	verb[counter2] = letter;
	File << verb[counter2];
   }
	cout << endl;
	File << endl;
  }
  }

  if (wordType == 2)
{
 cout << "Noun.\n";
 for ( int counter = 1; counter <= 100; counter++ )
 {
  i = 1 + rand() % 100;
  if ( i < 7 )
  {
	i = 1 + rand() % 100;
	if ( i < 14 )
	letter = 'i';
	else if ( i < 33 )
	letter = 'e';
	else if ( i < 58 )
	letter = 'a';
	else if ( i < 81 )
	letter = 'o';
	else if ( i < 91 )
	letter = 'u';
	else
	letter = '.';
	firstletter = TRUE;
	cout << letter;
	noun[1] = letter;
	File << noun[1];
  }
  i = 1 + rand() % 100;
  if ( i < 3 )
	j = 1;
  else if ( i < 11 )
	j = 2;
  else if ( i < 36 )
	j = 3;
  else if ( i < 75 )
	j = 4;
  else if ( i < 95 )
	j = 5;
  else if ( i < 98 )
	j = 6;
  else if ( i < 99 )
	j = 7;
  else
	j = 8;
  for ( int counter2 = 1; counter2 <= j; counter2++ )
  {
   i = 1 + rand() % 100;
	if ( i < 13 )
	 letter = 'N';
	else if ( i < 18 )
	 letter = 'M';
	else if ( i < 24 )
	 letter = 'P';
	else if ( i < 28 )
	 letter = 'B';
	else if ( i < 32 )
	 letter = 'T';
	else if ( i < 35 )
	 letter = 'K';
	else if ( i < 44 )
	 letter = 'C';
	else if ( i < 49 )
	 letter = 'F';
	else if ( i < 61 )
	 letter = 'S';
	else if ( i < 67 )
	 letter = 'R';
	else if ( i < 75 )
	 letter = 'X';
	else if ( i < 85 )
	 letter = 'H';
	else if ( i < 90 )
	 letter = 'L';
	else if ( i < 95 )
	 letter = 'Y';
	else
	 letter = 'W';
	cout << letter;
	if ( firstletter )
	{
	 noun[2*j] = letter;
	 File << noun[2*j];
	}
	else
	{
	 noun[2*j-1] = letter;
	 File << noun[2*j-1];
	}
	i = 1 + rand() % 100;
	if ( i < 14 )
	 letter = 'i';
	else if ( i < 33 )
	 letter = 'e';
	else if ( i < 58 )
	 letter = 'a';
	else if ( i < 81 )
	 letter = 'o';
	else if ( i < 91 )
	 letter = 'u';
	else
	 letter = '.';
	cout << letter;
	if ( firstletter )
	{
	 noun[2*j+1] = letter;
	 File << noun[2*j+1];
	}
	else
	{
	 noun[2*j] = letter;
	 File << noun[2*j];
	}

  }
 cout << endl;
 File << endl;
 firstletter = FALSE;
 }
}


  if (wordType == 3)
{
 cout << "Glyph Code.\n";
 for ( int counter = 1; counter <= 100; counter++ )
 {
  i = 1 + rand() % 100;
  if ( i < 3 )
	j = 3;
  else if ( i < 11 )
	j = 4;
  else if ( i < 36 )
	j = 5;
  else if ( i < 75 )
	j = 6;
  else if ( i < 95 )
	j = 7;
  else if ( i < 98 )
	j = 8;
  else if ( i < 99 )
	j = 9;
  else if ( i < 99 )
	j = 10;
  else if ( i < 99 )
	j = 11;
  else
	j = 12;
  for ( int counter = 1; counter <= j; counter++ )
  {
   i = 1 + rand() % 100;
   if ( i < 3 )
	 k = 1;
   else if ( i < 11 )
	 k = 2;
   else if ( i < 36 )
	 k = 3;
   else if ( i < 3 )
	 k = 4;
   else if ( i < 11 )
	 k = 5;
   else
	 k = 6;
   for ( int counter2 = 1; counter2 <= k; counter2++ )
   {
	i = 1 + rand() % 100;
	if ( i < 11 )
	  letter = 'A';
	else if ( i < 36 )
	  letter = 'B';
	else if ( i < 75 )
	  letter = 'C';
	else if ( i < 95 )
	  letter = 'D';
	else if ( i < 98 )
	  letter = 'E';
	else if ( i < 99 )
	  letter = 'F';
	else if ( i < 99 )
	  letter = 'G';
	else if ( i < 99 )
	  letter = 'H';
	else if ( i < 99 )
	  letter = 'I';
	else if ( i < 99 )
	  letter = 'J';
	else if ( i < 99 )
	  letter = 'K';
	else
	  letter = 'L';
	i = 1 + rand() % 100;
	if ( i < 11 )
	  no1 = '1';
	else if ( i < 36 )
	  no1 = '2';
	else if ( i < 75 )
	  no1 = '3';
	else if ( i < 95 )
	  no1 = '4';
	else if ( i < 98 )
	  no1 = '5';
	else if ( i < 99 )
	  no1 = '6';
	else if ( i < 99 )
	  no1 = '7';
	else if ( i < 99 )
	  no1 = '8';
	else
	  no1 = '9';
	i = 1 + rand() % 100;
	if ( i < 11 )
	  no2 = '1';
	else if ( i < 36 )
	  no2 = '2';
	else if ( i < 75 )
	  no2 = '3';
	else if ( i < 95 )
	  no2 = '4';
	else if ( i < 98 )
	  no2 = '5';
	else if ( i < 99 )
	  no2 = '6';
	else if ( i < 99 )
	  no2 = '7';
	else if ( i < 99 )
	  no2 = '8';
	else
	  no2 = '9';
   glyph[3*j-2] = letter;
   glyph[3*j-1] = no1;
   glyph[3*j] = no2;
   file << glyph[3*j-2];
   file << glyph[3*j-1];
   file << glyph[3*j];
   cout << letter;
   cout << no1;
   cout << no2;
   }
	i = 1 + rand() % 100;
	if ( i < 11 )
	  lift = 'M';
	else if ( i < 36 )
	  lift = 'N';
	else if ( i < 75 )
	  lift = 'O';
	else if ( i < 95 )
	  lift = 'P';
	else if ( i < 75 )
	  lift = 'Q';
	else
	  lift = 'R';
   glyph[] = lift;
   file << glyph[];
   cout << lift;
  }
 }
 cout << endl;
 File << endl;
 }
}



  if (wordType == 4)
doitagain = FALSE;
  cout << endl;
 }
File.close();
return 0;
}
//---------------------------------------------------------------------------

  • Like 1

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Basically just needed a few changes - variables used out of scope and such. The headers should all be there now, you don't need to have all the specific namespaces or anything.

 

A quick hack and it seems to do what you want, tho the logic allows it to run off into the sunset if you enter anything strange.

 

Pastie

 

If you're doing stuff like this every now and then, you might want to just learn some python basics(it's super simple, compared). Save you a lot of time, and having fun ways to work with strings and text if great if you're doing ling stuff.

Link to comment
Share on other sites

i think it needs the full path like this

 

#include "../include/common.h"

 

If the file is a local dependency (i.e you have the header you want to include and it's been written by you - or as part of the project or whatever) then you use the quotation marks to include it with a relative path. If the header is part of the system libraries, as with standard libraries, then you use the angled brackets (they can also have a relative path, depending on how things are set up). Standard headers (i.e that are supplied as part of any standards compliant compiler/toolchain) are generally referred to without the .h extension these days.

 

If your build system/IDE is correctly setting the library paths, you should not have any problems with the changed version of mine. Didn't test with VS, but yeah.

 

As for the pragma directives, they depend on the compilers cpp (c preprocessor) and generally avoided unless you know exactly where the code will be getting compiled; as they vary a *lot* between vendors.

 

Thanks for eating my formatting forum :/

Link to comment
Share on other sites

Ok that did it. Thanks Serp.

Yeah the logic is ridiculous & begging for trouble, and probably the first thing to fix up.

I'll look into Python. I like learning C++ so I can at least read the Dark Mod code & have a vague sense of what's going on.

 

@MoroseTroll, of course you are right. It was like the 2009 version, and it had a big Roman helmet for an icon.

 

---

Edit: As for what it does, I made a ConLang (constructed language)! B)

I invented my own language with its own grammar, and this program is for making a dictionary with all the most used vocabulary. You might see the difference between verbs, which are on a root system like Hebrew & Arabic (4 consonants that you fill in with different vowels for the tense) and nouns, which are consonant-vowel nuggets like Japanese & Hebrew again.

 

It's called (so far) Wasmaxna, and it's roughly a mix of Japanese (structure), Hebrew (verbs), and Choctaw (grammar), with a little German & English & Portuguese... i.e., the languages I know. The writing looks a little like Japanese characters done in a Hebrew calligraphy style.

 

I've already got a good grammar worked out (V-S-O), and once I finish the dictionary, my next step is to translate an entire essay so I can learn how the language actually works, and develop the grammar & vocabulary more. I've picked Emerson's "Self Reliance" for my essay.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Just a couple of stylistic points, since I will assume Serpentine's version has fixed any bugs or compilation issues:

  1. Declaring all your variables in a big block at the beginning of a function isn't necessary in C++ or any modern C implementation (I think the requirement was officially removed in C99 but all modern compilers will support it even if not specifically instructed to use the C99 standard). Some people still choose to do it as a matter of style, but I don't think it's the norm amongst C++ programmers and I personally find it makes the code harder to read and understand.
  2. You shouldn't be using static arrays with arbitrary "magic numbers" limiting their size (like "string noun[20]"), this can lead to incorrect behaviour when some other code doesn't know about the magic limit and tries to access outside the array (there is no limit checking, it will just break), and it requires more changes if you need to modify the code later. Learn how to use standard library containers such as std::vector and std::list, along with their various advantages and disadvantages compared to each other.
  3. That function is way too long to be easily readable or maintainable. Try to break up your functions so that they can fit on about one page, with calls to other (intuitively-named) sub-functions to perform various component tasks. You'll thank yourself for it when you need to revisit that algorithm in six months' time.
  4. Make your variable names useful - "counter1" and "counter2" don't give any information about the purpose of the variable. It's much clearer to use names like "currentPosition" or "wordCount".

Of course you will probably already have observed that coding style discussions can be one of the major flamewar topics amongst programmers, since for every C++ programmer advocating practices such as these there will be at least one died-in-the-wool FORTRAN77 greybeard insisting that structured code is "too slow" and everything should be done using nested loops iterating over massive arrays of floats, so YMMV.

Link to comment
Share on other sites

When I did the code for the ambient sound, I spent a lot of effort to have good style & make it readable and sensibly broken down, in just the ways you are mentioning. (Some variables are declared around where they're used, the counters & all the variables have understandable names, I commented on what each step was doing & how, etc.)

 

For this little exercise, it's a one-off thing just for me where I just wanted to do a job & threw something together... Also it's from a while ago before I knew as much as I know now. And I don't have so much time now to rewrite things just for that. When I code something I care about reading & maintaining though, I'll keep your points in mind. :)

 

Edit2: I've started my translation exercise. Only 2.5 sentences so far, and that took a while to do! If you guys are interested in following it, here's the link.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

From a translator's perspective, this is absolutely fascinating. May I ask what made you start this project (language-building and all)?

My Eigenvalue is bigger than your Eigenvalue.

Link to comment
Share on other sites

Edit2: I've started my translation exercise. Only 2.5 sentences so far, and that took a while to do! If you guys are interested in following it, here's the link.

This is far off the train tracks of this thread, but oh dang this is cool! :) I love exercising language muscles every once in a while. Lets see what I can deconstruct from just your interlinear here. I'm a little interested to see if my guesses are close to the actual grammar.

 

Verbs, like you said, look vaguely Hebrew to me, and just as complicated. o_i vowels for present indicative (cf. Qal imperfect), u_e for past indicative (cf. Qal perfect), a_a for other present moods like subjunctive/imperative (at least in what I've seen so far). It looks like you've got a prefix system for identifying verb subject/object. And for mood indicators, you must be using suffixes (cf. Hitpael/Hishtafel's added consonance)? kixkul-pahbaf-nofo = "which they may contain", where the modal "may" is nofo?

 

Subject and Object seem to have particles attached to them (ma and ca respectively?), a bit like Hebrew does with the אֵת־ direct-object-indicator.

 

I believe I can identify "e" as a postpositive definite article?

 

Word order of modifiers (adjective->noun) is the English influence peeking through?

yay seuss crease touss dome in ouss nose tair

Link to comment
Share on other sites

This is far off the train tracks of this thread, but oh dang this is cool! :)

On the contrary, this thread should really be about my language project. That's what I'm working on in the big picture, and the C++ Program was just one little part. It would be a great pleasure for you guys to ask me about my project so I can talk about it. It's something fun for me!

 

From a translator's perspective, this is absolutely fascinating. May I ask what made you start this project (language-building and all)?

 

My undergraduate work was in cognitive science, well technically in the Philosophy department, so the logic side of it. But I was taking a lot of cogsci classes. And philosophy of language, language cognition, & linguistics were the areas I was most interested in. And then independently Hebrew & Japanese (and some German) were the foreign languages I studied. So half of it is a fun way to learn how languages work from the inside in actually *constructing* them. And the other half is sort of an homage to the languages I studied by seeing if they could be combined in fun & creative ways -- Japanese, Hebrew, and another language Chickasaw (along with its sister tongue Choctaw), which is connected to my family history. And I was always interested in translating. But it's when I stumbled onto some tutorial sites for *how* to make a ConLang that I saw that it's something that can actually be done. So I ran with it.

 

Lets see what I can deconstruct from just your interlinear here. I'm a little interested to see if my guesses are close to the actual grammar.

 

Alright MD, let's see what you've cracked just from what you've seen. I'm in the process of trying to write all my scattered notes into a grammar textbook, and I'm realizing it needs a lot of cleaning up. I'm learning my own language almost like a foreign language as I go.

 

Generally, you're seeing the Hebrew connection. The other pieces are Japanese & Chickasaw.

Chickasaw is the core grammar. You start with a time conjugated verb with a SO prefix, then list the elements. Then like Japanese, the cases are tagged (although as you noticed, Hebrew also does this with "et-" for direct objects. Japanese does it for many of the other cases too, "ha", "ga", "wo", "ni"...). Like Japanese (and unlike Hebrew's "et"), the tags come at the end of the phrase it's tagging.

 

Note on pronunciation, to keep it one letter, C="Ch", X="Sh", and R is between a French guttural R to Hebrew "ch".

 

Verbs, like you said, look vaguely Hebrew to me, and just as complicated. o_i vowels for present indicative (cf. Qal imperfect), u_e for past indicative (cf. Qal perfect), a_a for other present moods like subjunctive/imperative (at least in what I've seen so far). ...And for mood indicators, you must be using suffixes (cf. Hitpael/Hishtafel's added consonance)? kixkul-pahbaf-nofo = "which they may contain", where the modal "may" is nofo?

 

Yes! You have the 4 letter roots and add vowels just as you said, o-i for present indicative, u-e for past indicative, and a-a for modals, which add a suffix for some modals, "nofo" indeed being the "may" modal, and "halos" for the imperative (not really a modal, but it got into that category. Reciprocal should also be a suffix like Hebrew's hitpael, good guess!, currently "yalos". Also "must", "can", etc.)

 

It looks like you've got a prefix system for identifying verb subject/object.

Yes, by gender & number, in the order SO. So if you wanted to just say "He saw her", you can say the whole thing with just the verb: Yisi-suplel. (Yi ="he" male subj, si = "her" female obj.) If you wanted it to be "John saw Jane", it'd be Yisi-suplel Can ma Cen ca.

 

Subject and Object seem to have particles attached to them (ma and ca respectively?), a bit like Hebrew does with the אֵת־ direct-object-indicator.

Yes, ma is the subject tag, and ca is the object tag. There are also tags for indirect objects, and like Japanese, the participles sort of work like tags for objects of participles (in, on, through, from, etc.)

 

I believe I can identify "e" as a postpositive definite article?

Yes. (There is no indefinite article. Like Hebrew a bit again.) And can you see the modifier for plural? (At least one of the words in my translation is plural and you can see how it differs from the singular ones.)

 

Word order of modifiers (adjective->noun) is the English influence peeking through?

 

Actually it's closer to Japanese, the difference being is that English usually has relative clauses after the noun ("the big train, which I saw.") whereas Japanese (and Turkish) is strictly head-final. All modifiers go before the noun on pain of death! Relative clauses work like adjective phrases. So it'd be "the seen-by-me big train".

 

Now we have a verb again, so we have the Chickasaw/Hebrew style again, with one extra flavor. And this is where the English did influence a little. Instead of "I-it-saw" (for "the train which I saw"), you replace the noun you're modifying with a "what" (or whatever the interrogative word is for it), in this case the TRAIN. So "the train which I saw" would be "I-what-saw". [it's a little like how we do English. "The train (I saw it) was going fast." You replace the 'it' with 'which', and put the "which" up front, so it's: The train, which I saw, was going fast."]

 

So for our Wasmaxna -- if we want to translate "The big train, which I saw, was going fast." -- you'd start with the head verb, "is", the copula linking Train to "going fast" (edit: sorry, actually you'd start with the past progressive "was going", so I'm going to have to fix the next sentences...). So we'd start with "It(subj)-WAS_GOING". Then you add the relative phrase modifying the train, "I saw it", replacing the "it" slot for the train-object with "what". So you'd next have "I-what-SAW". It was a "big train" which I saw, so after the "I-what-SAW", we put the "BIG" adjective. Then you'd finally have the noun head, the word "TRAIN". Then you post mark it with the subject tag "ma", for the first head verb (WAS GOING). (Notice like relative clauses can do, it's also in the role of object of the relative verb, "I saw it", but we don't put an object tag for it. The way we communicate it's an object of that second verb is like English, we use the interrogative "what" (or "which" in English) in the object spot of the verb.)

 

Then finally we have "fast", which is the adverb on the verb "WAS GOING". Adjectives and adverbs are currently indistinguishable. They don't modify by anything. And they don't get any markers. So you just throw the word there at the end and let it stands, and context tells you it modifies either the train or going fast. Hmm, maybe I should distinguish adjectives & adverbs after all. Well, wait, the adjectives all go before the noun... So obviously if it were a "Fast train", "FAST" would have gone next to "BIG". But for adverbs, since it's VSO, modifiers of verbs are currently thrown at the end and the verb links to them somehow. I will have to think about this more. But anyway, currently you just throw fast at the end & context tells you it's modifying the WAS GOING.

 

So using the past progressive form I currently have, the translation would be:

Ki-kuybexbit kikul-suplel hiceka liya mae babate.

Past progressive of "TO GO" (Kuybex=past simple; + BIT=progressive). KI = the suffix for a neuter subject (notice there's just one slot for that verb since it's intransitive, the subject, the "seen-by-me big train" that takes the slot with "mae", the subject-definite marker. There's no object slot in the verb like you see in other examples, like Yisi-, etc.). And then the word FAST is thrown at the end, with context telling you it's modifying the GOING, which you're supposed to know is referring to "going" by the context.

 

[Footnote: Before I was thinking of "going fast" as a gerund, maybe a stupid mistake. If you did it that way, the head verb would be the copula "IS", which links the train to a gerund "GOING" as a reified noun, with "o-u-o". So if the verb "to go" is KYBX, "going" would be "koyubox", without any suffixes since it's like infinitive. And you'd put "fast" in front of that gerund like an adjective. The TRAIN WAS [FAST-GOING].

 

"The big train, which I saw, was going fast.", would then look like [it-it-WAS] [i-what-SAW] [bIG] [TRAIN] [subj-definite tag] [FAST] [GOING] [complement tag].

Kiti-hukxer kikul-suplel hiceka liya mae babate koyubox sa.

Then a copula tag, "sa" (I think I was going to use that? It's still a trial rule).

In as close to literal English as I can get: "Was the-seen-by-me big train fast-going."

 

Hmm, I say it was a mistake to use a copula when the verb was actually past progressive, but maybe my intuition was telling me something after all to use it like a copula (English blurs the line after all). I did run into the problem linking adverbs to the head verb, and that's sort of what the "WAS" serves to do for the Past Progressive form in English.]

 

As you can see I'm still learning it & developing it as I understand it better. Thanks for taking notice!

 

Edit: If anyone reads this far, I'll reward them with the running rough draft of my grammar urtext: https://docs.google....QyjcJfdkVo/edit

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

I'm looking through your grammar (fascinating, by the way!), and kind of stopped by the verb chart. I'm guessing by your example "The big train, which I saw, was going fast" that you're not going to have dedicated passive forms? Hebrew verbs have to switch conjugations (and therefore change consonants -- a very messy business) to get to passive-ish forms like Nifal and Pual. Although, in your defense, as I translated the book of Ruth I noticed that -- just like your example -- the majority of passive constructions ended up using [Participle] + [optional TO_BE ]+ [optional לְ-indirect object]. cf. Ruth 3:8 = "And behold, a woman was lying down at his feet"

 

וְהִנֵּ֣ה אִשָּׁ֔ה שֹׁכֶ֖בֶת מַרְגְּלֹתָֽיו

[feet-his] [Qal F.Sg Participle LIE_DOWN] [woman] [& Behold!]

 

(Edit: In retrospect, this is a bad example of a passive construction, coz it's not even a transitive verb in Qal. Better is probably 2:20 "Blessed is he by the Lord." -- another Qal Participle + לְ agent)

 

What are you doing with non-transitive verb forms such as DIE or STAND? Will it simply lack the object prefix marker?

 

I also saw preliminary Jussive ideas "Let us __" verb forms. A Singular jussive "Let me __" may not be a bad idea if you're mimicing Hebrew verb construction. Speaking of mimicing Hebrew verbs, (If I may be so bold as to make suggestions!) I think I like the i:a vowel choices for jussives, just as Hebrew Jussives look much like shortened imperfect.

 

It looks like you've got Cohortative "May you __, May he __, May they __, and (rarely) May I/we __" is also possible amongst the rest of the verb moods.

 

Counting and numbers can be a beast. I'm not certain what you'd prefer. Hebrew's noun construct-chain number system is an absolute mess sometimes. For another slightly-less archaic system, you could use Greek/Latin's already somewhat base-10 compatible system.

 

Another grammatical construct that I'm curious about is how you'll take care of double accusatives (as in Latin/Greek/German). For example,

"Demagogue will teach you everything"

Δημαγόγος ὑμᾶς διδάξει πάντα.

[NOM Demogogue] [ACC Plural pronoun You] [he will TEACH] [ACC Plural All [things]]

 

Latin sometimes forgos indirect objects in favor of double accusitives in common idioms.

"He asked the king for money"

pecuniam regem rogavit

[ACC money] [ACC king] [he ASKed]

 

Relatives are always tough to take care of. Ancient/Classical/Attic/Koine Greek all do it pretty well with a gender+number agreeing pronoun, usually set apart within commas (as english likes to do).

"A man was in Jerusalem, whose name was Simon"

ἄνθροπος ἦν ἐν Ἰερουσαλὴμ, ὄνομα Συμεὼν

[man] [he WAS] [in] [Jerusalem] [to whom] [name] [simeon]

 

Hebrew, as you know, just has the nasty enigmatic אֲשֶׁ֥ר which is basically shouting "RELATIVE PHRASE COMING UP HERE!". Perhaps since you've got a "what" pronoun (kul) to tack inside your verb prefixes, that ambiguity is already solved.

yay seuss crease touss dome in ouss nose tair

Link to comment
Share on other sites

Heh, it's very clear which of us has actually formally studied linguistics and which one of us is figuring this out as he goes along. ^_^

 

Thanks for all the useful examples.

 

Yes, intransitive verbs lack the object prefix.

I had an example in my last post, Ki-kuybexbit, the train "it-was.going".

I was toying around with how to mark even intransitive verbs with some modifiers on the verb (like adverbs or participle phrases), so you could have an "it object" to stand in for "quickly" or "through the countryside"... But I think that approach may self-destruct in the end, so it's out for now.

 

The "Let us __" form came from Japanese, but now I remember the Hebrew, and you make a good suggestion with imperfect-light.

 

I lifted counting from Japanese. It's better than *our* (English) counting IMO. 1,234 would be "1-thousand, 2-hundred, 3-10 4", and 14 is "ten-four". No ambiguity. (Japanese often mishear 15 and 50, even we do sometimes, but 5-10 and 10-5 are clear as day.) The difference of mine to Japanese is they count 10,000 as its own unit, but I'll just keep it in ten-thousands and 100-thousands, then 1-million, and so on all the way up.

 

Yes on Hebrew I originally had a "xu" (shu) which marked the entry into a relative phrase, and asher was probably in the back of my mind. Yeah I like using the prefixes to mark relatives though. I like that logical approach that Lobjan uses where a verb is always tied to its arguments with clear markers, so you know what job every part is doing built right into the head verb. Then sentences are like little solar systems. The verb is the sun & each planet is marked as an argument going out. If you want another thought, you just start a new head verb as a new system.

 

Ah yeah, the passive voice. Passives, and voice generally, is on my to-do list, and I was premature to release what I have (I just asked the C++ question, it's not like I was at any stopping point). I'll have to sit down and work them out because right now I don't know what to do with them except make a new conjugation. And I can foresee it throwing a big loop to the whole prefix system, when you want to talk about something getting-done-to it. Does it take the first(S) or second(DO) slot, or maybe switch the slots (DO.S), or have the Obj prefix by itself (also possible). And should I have a new case tag for passive-voice subjects, or the S tag, or the DO tag?

 

Actually this was a little influenced by Lojban (the logical ConLang) in making the verbs, with all verbs having "argument" slots, and then the tags specify which slot a clause is taking, everything under the "ma" tag meant for the first slot, and "ca" for the 2nd slot, and I toyed with having (optional) 3+ slots for indirect objects & prepositional phrases that would have their own slots & tags. (Incidentally, it's interesting that a computer science approach in Lobjan & the native languages Choctaw & Chickasaw would have come to a similar approach! Using verb prefixes for its arguments, then filling the arguments with the rest of the sentence. Possibly not for entirely different reasons.)

 

But anyway in that thinking, the passive subject should take the first subject slot and the noun get the "ma" (first slot) tag, and the verb conjugation is doing the work telling you it's passive, getting the verb done to it, by the 2nd slot object (marked with ca, the 2nd slot tag). And then the prefix cases ("Ya" vs. "Fa", "I" vs. "me") could actually be active & passive voice declinations.

 

For now, to conjugate it I'll take indicative past, present & future & add a verb suffix from the start of the word "to undergo" = "nip" (or nipmo).

 

So "I eat the apple" would be:

"Ya-ti-wonxis lasawihu ca."

[i.active-it.passive-EAT] [APPLE] [Object (i.e., 2nd argument)].

 

Then "The apple is eaten." would be:

"Ti-wonxis-nip lasawihu ma."

[it.passive-EAT-undergo] [APPLE] [subject (i.e., 1st argument)].

 

Edit: Maybe, instead of Eat-undergo, Ate-undergo, it would be more natural like "Underwent eating", "will undergo painting", etc.

Then that would be:

Ti-nopmix wunoxus lasawihu ma

[it.passive-UNDERGOES] [EATING] [APPLE] [subject].

 

Or even ???

Kiti-nopmix lasawihu ma wunoxus ca.

[it.active-it.passive-UNDERGOES] [APPLE] [subject] [EATING] [object].

 

Hmm, have to think about it. If I did it more like lobjan, there'd be a "null" marker for arguments not used (i.e, a 2nd slot there filled with the null, so no information on what's eating the apple. Just it's being eaten. But that's a little *too* logical. I need to read more linguistics. I'm so newbie at all of this! Not really qualified to be making my own language lol, but trying it anyway.)

 

Edit: To summarize that though, I think what it's saying is verbs often come with two prefix arguments/slots, the first is nominative case (subject), the second is oblique case, object (for intransitive verbs, you just have the nominative slot). Then you have markers in the sentence, ma and ca, telling you which slot the noun phrase takes. (Indirect objects get a "ko" tag. But so far I don't have a 3rd or more slots in the verb just so it doesn't get unwieldy.) Then the first chart on my grammar page also says the prefixes modify, and there it said by "subject" and "object" (I vs. me, she vs. her), but that job is already done by the prefix order. What I think I want that modification to be doing is voice, active vs. passive. Then you can put the passive voice into the nominative argument. That sounds like it could work, but I don't know if it will blow up in my face later. I guess I have to do translations to find out!

 

Edit2: Double accusatives. Ah, very interesting! If you see issues like that please let me know, or it might take me forever to see it on my own.

 

If I just stack "ca" markers after each one, I think the context would make it understandable. But it doesn't conjugate to a single verb prefix as well. Looking at your examples, they are reminding me of the 3+ argument verbs in Lobjan. So I could have secondary accusative markers, the first "ca" conjugates, and the later "ca"s are secondary... maybe...

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Ah, my program has a bug in a curious way! It wasn't under this version, but either the Borland version or the BASIC version I originally had on a toy interpreter. My guess is the random operation is some function of the clock, because what would happen is I would get an *entire* spread of almost all 100 words being identical to a previous spread. Because they were non-sense words, I didn't notice until now actually looking through the list.

 

What I think happened is, it'd randomize by the clock, and then each operation took so many clicks of computation time, so if you ran it twice and it started on that same number, it'd naturally take the same number of clicks so the next random number would also be the same, and so on ad infinitum. It would "randomly" create the same spread of words all over again.

 

Anyway, the punchline is, out of a ~1500 word list, practically hundreds of them are repeats of each other. But because I added words in between, and sometimes I broke words up into two, and sometimes the run would diverge on its own, they're not always obvious to find without a direct serial search... Ugh, I'll start with trying to order the word list alphabetically (if I can figure out how on MS Word) and weed most out that way. Then the rest I'll have to find them by hand and re-do them. What a strange issue to deal with, I didn't expect it to fail so sensationally.

 

Edit: I caught 590 repeats, ugh. Can't believe I didn't see them earlier! I have to replace all of them. And those are only the ones I caught. Maybe there are more! But re-doing all ~2000 words from scratch would to be sure would take so much longer. Blech.

 

And I confirmed it's for the VS 2010 version. So there you go. If you use the random operation, there's a high chance it will repeat a previous use of itself sequentially. If there are 1500-2000 words, and 5 repetitions (about the average), where 1 repetition is about 100 words, I believe that works out to a ~1/3 to 1/4 chance of repeating a pattern. Is that right? That sounds awfully high.

 

Edit2: No, it's repeating exactly in sequence every time. If I do it the first time, it repeats a pattern. Then running it the 2nd time repeats the next pattern that followed the first time. So random isn't working by the clock. It's just always picking the same numbers in the same order when you run it, for as long as you want it to run. So if you really want new numbers, you have to run it beyond where you've run it the first time. Interesting.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Edit2: No, it's repeating exactly in sequence every time. If I do it the first time, it repeats a pattern. Then running it the 2nd time repeats the next pattern that followed the first time. So random isn't working by the clock. It's just always picking the same numbers in the same order when you run it, for as long as you want it to run. So if you really want new numbers, you have to run it beyond where you've run it the first time. Interesting.

Ah, the novelty of pseudo-random numbers. It's been some time since I've been in C++, so I can't remember how std::rand works anymore. In Visual Basic, you have to call Randomize() to generate a new seed for Rnd() to use. Otherwise Rnd() uses the same seed every time you call it.

 


Public Function DiceRoll(ByRef sides As Integer)
	'''' Do a dice roll and return the value
	'''' Usage: e.g. DiceRoll(20) will return a number 1-20 (as in a d20 die)
	Dim roll As Short
	Randomize()
	roll = Math.Ceiling(Rnd() * sides)
	Return roll
End Function

 

Can any of our C++ gurus jump in?

yay seuss crease touss dome in ouss nose tair

Link to comment
Share on other sites

relatively unindependent from the specific programming language most pseudo-random-number creators work as follows:

 

the new number is generated from the old number by a simple function new=f(old)

this generates a sequence a->f(a)->f(f(a))->f(f(f(a))) and so one

 

the argument of srand() is the starting number a

so if you want to have different sequences everytime you start the programm you should use something like the system time as mentioned by MoroseTroll

 

note that pseudo-random does not equal random; it means that the generated sequence if executed infinite behave like a random distribution

(almost as, due to the rounding errors on machines though)

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 2 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...