Note that there are some explanatory texts on larger screens.

plurals
  1. POC# Method not returning a unique value when it should be
    primarykey
    data
    text
    <p>I have two methods, generateNounPhrase() and generateVerbPhrase(). VerbPhrase will call on NounPhrase half the time and it's output the output should be something to the effect of:</p> <blockquote> <p><strong>the empty lot</strong> re-animates <strong>this pyramid</strong></p> </blockquote> <p>(bold indicating where generateNounPhrase() is logically called). The true output however is in the form of:</p> <blockquote> <p><strong>the empty lot</strong> re-animates <strong>the empty lot</strong></p> </blockquote> <p>At first I thought my randomIndex method wasn't working as I had intended, but if I run the two methods again I do get different noun phrases but they are not unique at the beginning and end of the sentence as they should be.</p> <p>Any idea what I am doing wrong in order to get one method to show the same result?</p> <pre><code>private string generateNounPhrase() { string nounPhraseString = ""; nounPhraseString = nounMarkersStringList[randomIndex(0,nounMarkersStringList.Count-1)]; if (included(1, 4, 2) == true) { nounPhraseString += " " + adjectivesStringList[randomIndex(0, adjectivesStringList.Count - 1)]; } nounPhraseString += " " + nounsStringList[randomIndex(0, nounsStringList.Count - 1)]; return nounPhraseString; } private string generateVerbPhrase() { string verbPhraseString = ""; if (included(1, 4, 2) == true) { verbPhraseString = intransitiveVerbsStringList[randomIndex(0, intransitiveVerbsStringList.Count - 1)]; } else { verbPhraseString = transitiveVerbsStringList[randomIndex(0, transitiveVerbsStringList.Count - 1)] + " " + generateNounPhrase(); } return verbPhraseString; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload