<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>Tagged with charat() - Processing 2.x and 3.x Forum</title>
      <link>https://forum.processing.org/two/discussions/tagged/feed.rss?Tag=charat%28%29</link>
      <pubDate>Sun, 08 Aug 2021 19:06:08 +0000</pubDate>
         <description>Tagged with charat() - Processing 2.x and 3.x Forum</description>
   <language>en-CA</language>
   <atom:link href="/two/discussions/taggedcharat%28%29/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>Int(str), where str is a single-digit number, gives the utf char code instead of the number as int</title>
      <link>https://forum.processing.org/two/discussion/26850/int-str-where-str-is-a-single-digit-number-gives-the-utf-char-code-instead-of-the-number-as-int</link>
      <pubDate>Wed, 14 Mar 2018 21:08:41 +0000</pubDate>
      <dc:creator>samuset</dc:creator>
      <guid isPermaLink="false">26850@/two/discussions</guid>
      <description><![CDATA[<pre><code>String pi = "31415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170";

int x;

void draw () {
  for (int i = 0; i &lt; pi.length(); i++) {
    x = int(pi.charAt(i));
    println(x);
  }
}
</code></pre>

<p>And this prints numbers around 48-58 as x in the log. I'm dumbfounded as to why it wouldn't give me the right characters from the String pi. Thank you for your help in advance.</p>

<p>Edit: I realized the <code>int(pi.charAt(i))</code> is not working, as this results in the utf-8 character code of the given number from 0 to 9, which are 48-57. Of course, I can work around this, but would still be best to see how this should be done properly.</p>
]]></description>
   </item>
   <item>
      <title>Why doesn't this function run in processing.js?</title>
      <link>https://forum.processing.org/two/discussion/26145/why-doesn-t-this-function-run-in-processing-js</link>
      <pubDate>Sat, 27 Jan 2018 23:10:41 +0000</pubDate>
      <dc:creator>FH79</dc:creator>
      <guid isPermaLink="false">26145@/two/discussions</guid>
      <description><![CDATA[<p>Hello,</p>

<p>I have written the following function, which formats text stored in a field of Strings (Textfeld) and stores the result in a new field (Textzeilen). It works fine in Processing, but once I try to execute it in a browser (using processing.js), it crashes with the error message "SyntaxError: missing ) after argument list".</p>

<pre><code>void ladeText(String datei)
{
  Textfeld = loadStrings(datei);

  Textzeilen = new String[2000];

  int i = 0, j = 0, k = 0;
  int breite = (int)(xt2-xt1-50);
  textFont(atari, 18);
  Textzeilen[0] = new String();
  textAnzMax = 0;
  do
  {
    char c = Textfeld[i].charAt(j);

    if(textWidth(Textzeilen[k] + c) &lt; breite)
    {
      Textzeilen[k] += c;
      j++;
    }
    else
    {
      int l = 0;
      while((int)Textfeld[i].charAt(j) != (int)' ') {j--; l++;}
      Textzeilen[k] = Textzeilen[k].substring(0, Textzeilen[k].length() - l);
      j++;
      k++;
      Textzeilen[k] = new String();
      textAnzMax++;
    }

    if(j==Textfeld[i].length()) 
    {
      if(i&gt;=Textfeld.length-1) break;
      j = 0;
      do
      {
        i++;
      }
      while(Textfeld[i].length() == 0);

      k++;
      Textzeilen[k] = new String();
      k++;
      Textzeilen[k] = new String();
      textAnzMax+=2;
    }
    //if(k&gt;=Textzeilen.length) Textzeilen = (String[])expand(Textzeilen);
  }
  while(true);

}
</code></pre>

<p>I strongly suspect it has something to do with the "char" datatype which doesn't exist in JS.</p>
]]></description>
   </item>
   <item>
      <title>How to make some texte move and change its opacity ?</title>
      <link>https://forum.processing.org/two/discussion/26040/how-to-make-some-texte-move-and-change-its-opacity</link>
      <pubDate>Fri, 19 Jan 2018 14:29:06 +0000</pubDate>
      <dc:creator>c_aamille</dc:creator>
      <guid isPermaLink="false">26040@/two/discussions</guid>
      <description><![CDATA[<p>Hello everybody,</p>

<p>I am starting with processing and I am a bit lost.
I would like to display some text in a defined rectangle and then, following the order of reading (upper left corner to bottom right corner), make each letter move randomly, as the same time as lowering its opacity until total dissapearing. 
I suppose it's possible but I have no idea wich function I should use !</p>

<p>Thank you very much for your help ! :)</p>
]]></description>
   </item>
   <item>
      <title>Movie files do not show, no error</title>
      <link>https://forum.processing.org/two/discussion/25854/movie-files-do-not-show-no-error</link>
      <pubDate>Sat, 06 Jan 2018 22:16:09 +0000</pubDate>
      <dc:creator>dehyde</dc:creator>
      <guid isPermaLink="false">25854@/two/discussions</guid>
      <description><![CDATA[<p>Hi
I'm trying to make video files load to represent letters (motion font basically);
For some reason the video files don't show. I tried following the examples but no succes. I'm also not getting any error.</p>

<p>Any ideas?</p>

<pre><code>String str = "abbaabbaa abb aabbaaab baaab";
int let  = 0;
int wordsNum = 1;

int t = 0;

int[] wordsLength;

float kerning = 0;
float leading = 0;
float charLocation = 0;
float lineLocation = 0;

float horMargin = 100;
float vertMargin = 100;

float fontHeight = 30;
float fontWidth = 40;


import processing.video.*;
Movie Alef;
Movie Bet;
Movie Gimel;
Movie Dalet;
Movie Hey;
Movie Vav;

public void setup() {
  size(1200, 900);

  // finding out how many words are there    (important for the wordsLength array)

  for (int i = 0; i&lt;str.length(); i++) {
    if (str.charAt(i)==' ') {
      wordsNum++;
    }
  }
  println("number of words is: ", wordsNum);


  int letCount = 0;

  wordsLength = new int[wordsNum];
  for (int i = 0; i&lt;str.length(); i++) {
    if (str.charAt(i)==' ') {
      wordsLength[t]=letCount;
      letCount=0;
      t++;
    } else {
      letCount++;
    }
  }
  println(wordsLength);

  //alef = loadImage("א.jpg");
  //bet = loadImage("ב.jpg");

  Alef = new Movie(this, "a.wmv");
  Alef.loop();
  Bet = new Movie(this, "b.wmv");
  Bet.loop();


  t=0;
}

void draw() {

  for (int let = 0; let &lt; str.length(); let++) {

    if (str.charAt(let)=='a') {
      image(Alef, width-horMargin+charLocation, vertMargin+lineLocation, fontWidth, fontHeight);
      println("a");
    };
    if (str.charAt(let)=='b') {
      image(Bet, width-horMargin+charLocation, vertMargin+lineLocation, fontWidth, fontHeight);
      println("b");
    };


    // Character Location

    charLocation = charLocation - fontWidth - kerning;
    //println(charLocation);


    // checking if it's a new word

    if (str.charAt(let)==' ' &amp;&amp; t &lt; wordsNum) {


      // creatng a new line

      if (width-horMargin+charLocation-wordsLength[t]*fontWidth &lt; horMargin) {
        charLocation = 0;
        lineLocation = lineLocation + fontHeight + leading;
      }
      t++;
    }



    //   if (width-horMargin+charLocation &lt; horMargin){

    //   }
  }
}

void movieEvent(Movie m) {
  m.read();
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Generating text letter-by-letter, letter spacing is off.</title>
      <link>https://forum.processing.org/two/discussion/24928/generating-text-letter-by-letter-letter-spacing-is-off</link>
      <pubDate>Thu, 09 Nov 2017 13:36:40 +0000</pubDate>
      <dc:creator>Qode</dc:creator>
      <guid isPermaLink="false">24928@/two/discussions</guid>
      <description><![CDATA[<p>Hello,</p>

<p>I'm using the below function to display text, but I'm displaying it on a letter-by-letter basis.</p>

<pre><code>    void displayText(String message, int x, int y, int w){

      int h = 0;

      for (int i = 0; i &lt; message.length(); i++) {
        if(message.charAt(i) == (' ') &amp;&amp; x &gt; w-50){
            h += 8;
        }
      }

      tbTranslate();

      rotateY(radians(6));
      fill(50,160);
      noStroke();
      rectMode(CORNER);
      rect((x-40)-((x+80)/2), (y-40)-((y+20)/2), w+80, h+60);
      fill(255);
      translate(-30,-30,1);
      textSize(32);
      textFont(font);

      for (int i = 0; i &lt; message.length(); i++) { 
        text(message.charAt(i), x+textBoxX/2, y-(textBoxY/2-40));
        x += textWidth(message.charAt(i));
        if(message.charAt(i) == (' ') &amp;&amp; x &gt; w-50){
            y += 32;
            x=0;
        }
      }
    }
</code></pre>

<p>But the letter spacing is very weird, it's inconsistent. I've found that it spaces individual characters consistently (example, it always spaces the "n" very far from the next character and the "a" very close to the next character), but is there something I can do for this function to space the letters a bit more naturally?</p>

<p>Anyone interested can check out the full project here:
<a href="https://www.dropbox.com/sh/uy3jtdov9s153wd/AACEYyk8QT7YdqNe8QpRGU-Ea?dl=0" target="_blank" rel="nofollow">https://www.dropbox.com/sh/uy3jtdov9s153wd/AACEYyk8QT7YdqNe8QpRGU-Ea?dl=0</a></p>

<p>Thanks in advance!</p>
]]></description>
   </item>
   <item>
      <title>CharAt command does not exist</title>
      <link>https://forum.processing.org/two/discussion/22997/charat-command-does-not-exist</link>
      <pubDate>Fri, 09 Jun 2017 12:56:53 +0000</pubDate>
      <dc:creator>tubbo</dc:creator>
      <guid isPermaLink="false">22997@/two/discussions</guid>
      <description><![CDATA[<p>Hi everybody,
I need help, the command charAt() does not work because does not exist. How can I fix It?
PLZ i need help.</p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/858/LTDR6LN1NKRA.PNG" alt="Capture" title="Capture" /></p>
]]></description>
   </item>
   <item>
      <title>Cheesboard lettering?</title>
      <link>https://forum.processing.org/two/discussion/22240/cheesboard-lettering</link>
      <pubDate>Thu, 27 Apr 2017 11:19:40 +0000</pubDate>
      <dc:creator>Flori12</dc:creator>
      <guid isPermaLink="false">22240@/two/discussions</guid>
      <description><![CDATA[<p>Hello everybody,</p>

<p>I just get started with processing some days ago so I hope somebody can help me with my problem:</p>

<p>I've written a code for a chessboard but I don't know how to letter the individual fields. Down on the left side i wanted "A1", right next to it "B1" etc.
How can I do it?</p>

<p>I hope someone can help me and sorry for my bad english - I'm from Denmark :)</p>
]]></description>
   </item>
   <item>
      <title>text processing</title>
      <link>https://forum.processing.org/two/discussion/21526/text-processing</link>
      <pubDate>Tue, 21 Mar 2017 20:06:56 +0000</pubDate>
      <dc:creator>Nekios</dc:creator>
      <guid isPermaLink="false">21526@/two/discussions</guid>
      <description><![CDATA[<p>Thanks</p>
]]></description>
   </item>
   <item>
      <title>why doesn't this code work? (charAt)</title>
      <link>https://forum.processing.org/two/discussion/19910/why-doesn-t-this-code-work-charat</link>
      <pubDate>Sun, 25 Dec 2016 05:53:20 +0000</pubDate>
      <dc:creator>nast777</dc:creator>
      <guid isPermaLink="false">19910@/two/discussions</guid>
      <description><![CDATA[<p>'l' is a variable being used. I want this code to take the number at location 'l' but I get the message "String Index Out Of Bounds Exception: String index out of range: 4" even though the value of l is less than 4.</p>

<p><code>if (saved.charAt(l) == 1)</code></p>
]]></description>
   </item>
   <item>
      <title>How to use an symbolic array create a picture?</title>
      <link>https://forum.processing.org/two/discussion/18836/how-to-use-an-symbolic-array-create-a-picture</link>
      <pubDate>Wed, 02 Nov 2016 01:16:57 +0000</pubDate>
      <dc:creator>Dan0715</dc:creator>
      <guid isPermaLink="false">18836@/two/discussions</guid>
      <description><![CDATA[<p>I have an 2D array now.
Like this in a .txt file:</p>

<h1>#</h1>

<h1>#</h1>

<h1>#$</h1>

<h1>###  $</h1>

<h1>#  $ $</h1>

<h1>## # ## #</h1>

<h1># ## #####  ..</h1>

<h1>$  $          ..</h1>

<h1>#### ### #@##  ..</h1>

<h1>#</h1>

<h1>#</h1>

<p>Each symbol(#、$、@) represent a image.
I need translate the array into a whole picture.</p>
]]></description>
   </item>
   <item>
      <title>Text from file</title>
      <link>https://forum.processing.org/two/discussion/18488/text-from-file</link>
      <pubDate>Mon, 10 Oct 2016 18:50:22 +0000</pubDate>
      <dc:creator>cookie23</dc:creator>
      <guid isPermaLink="false">18488@/two/discussions</guid>
      <description><![CDATA[<p>I want to tjek if the first letter in the test.txt file is "t". Why does this not work?:</p>

<pre><code>String lines[] = loadStrings("test.txt");
println(lines[0]);

String letter = lines[0].substring(1, 2);
println(letter);

if(letter == "t"){
  print("first letter is t!");
}else{
  print("first letter is not t!");
}
</code></pre>

<p>The console says:</p>

<p>ttt-test<br />
t<br />
first letter is not t!</p>
]]></description>
   </item>
   <item>
      <title>character within a string</title>
      <link>https://forum.processing.org/two/discussion/15525/character-within-a-string</link>
      <pubDate>Wed, 16 Mar 2016 18:32:01 +0000</pubDate>
      <dc:creator>jeffmarc</dc:creator>
      <guid isPermaLink="false">15525@/two/discussions</guid>
      <description><![CDATA[<p>string [] name={"name1","name2","name3"};</p>

<p>how do i address characters in string?
name[0][4] should be 1 name[1][4] should be 2 
what is the proper syntax, this worked in C</p>
]]></description>
   </item>
   <item>
      <title>Have to make a String method called cryptocode-can't figure it out</title>
      <link>https://forum.processing.org/two/discussion/15307/have-to-make-a-string-method-called-cryptocode-can-t-figure-it-out</link>
      <pubDate>Sat, 05 Mar 2016 20:59:12 +0000</pubDate>
      <dc:creator>lonewinds</dc:creator>
      <guid isPermaLink="false">15307@/two/discussions</guid>
      <description><![CDATA[<p>Here's the question:
 cryptocode accepts a string message.  It will scramble the alphabet, then use it to encode the string object so that the first letter in the scrambled alphabet will replace the letter 'A', the second letter will replace the 'B's and so on (encoded string is returned).</p>

<pre><code>HOW’S IT GOING?  with scrambled alphabet HOAZXJRTUYBIVEWKLSNCDMFGPQ   becomes
TWF'N UC RWUER?
</code></pre>

<p>I don't get how to replace the letters after generating the "new" alphabet</p>

<p>here's what i have done:</p>

<pre><code>public static String cryptocode (String cryptic)
{
    sc = new Scanner (System.in); 
    clear();

    StringBuffer alphabet = new StringBuffer("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
    String holder = "";

    //Generates a "new" alphabet
    for (int x=1; x&lt;=100; x++)
    {   
        char temp;
        int num1 = (int)(Math.random()*alphabet.length());
        int num2 = (int)(Math.random()*alphabet.length());

        temp = alphabet.charAt(num1);
        alphabet.setCharAt(num1, alphabet.charAt(num2));
        alphabet.setCharAt(num2, temp);
    }

    cryptic = cryptic.toUpperCase();
    System.out.println(alphabet);

    for (int x= 0; x &lt; cryptic.length(); x++)
    {
        //Can't figure out how to replace the letters using the new alphabet
    }

    return holder;
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>How do you display one letter of a sentence you have read in from a csv file</title>
      <link>https://forum.processing.org/two/discussion/14192/how-do-you-display-one-letter-of-a-sentence-you-have-read-in-from-a-csv-file</link>
      <pubDate>Wed, 30 Dec 2015 16:33:38 +0000</pubDate>
      <dc:creator>Winny</dc:creator>
      <guid isPermaLink="false">14192@/two/discussions</guid>
      <description><![CDATA[<p>text(questionsPhrasesData.getString(0,1) + "   phrase",5,150);
// this displays the complete phrase on the screen at 5,150 I want to display just 1 letter of this display someplace else on the screen.</p>
]]></description>
   </item>
   <item>
      <title>Replacing an array of strings with integer</title>
      <link>https://forum.processing.org/two/discussion/13178/replacing-an-array-of-strings-with-integer</link>
      <pubDate>Thu, 22 Oct 2015 16:12:49 +0000</pubDate>
      <dc:creator>yousufalin</dc:creator>
      <guid isPermaLink="false">13178@/two/discussions</guid>
      <description><![CDATA[<p>Hi,</p>

<p>I have an array of Strings, {a,b,c,b,a,d,a,c,a}. I wanted to sort and replace them with integers, and change it as {0,1,2,1,0,3,0,2,0}</p>

<p>As the first step I tried removing the repeating elements from the array and made another array of strings {a,b,c,d}. 
Then I used a for loop and assigned values for these strings as {0,1,2,3}.</p>

<p>Now I wanted to replace the individual members in the first array of strings, where "a" is replaced with "0", "b" with "1", "c " with "2" and "d" with "3", and make an array {0,1,2,1,0,3,0,2,0}</p>

<pre><code>String [] name = {"a", "b", "c", "b", "a", "d", "a", "c", "a"};

IntDict sortedName;
IntDict finalNameList;


void setup() {
  size(600, 600);
  smooth();

  sortedName = new IntDict();
  finalNameList = new IntDict();


  for (int i=0; i&lt;name.length; i++) {
    finalNameList.increment(name[i]);
  }

  String [] names = sortedName.keyArray(); //// sorted array of strings {a,b,c,d}

  for (int i=0; i&lt;names.length; i++) {
    finalNameList.set(names[i], i);
  }

  int [] values = finalNameList.valueArray(); ///// assigned values for a,b,c,d-- 0,1,2,3


  ////// now i wanted to replace the strings in the first array, name with the integers

  for (int i =0; i&lt;name.length; i++) {
    name[i]= name[i].replaceAll(names[i], i-names.length);

    println(name[i]);
  }
}


void draw() {

  background(125);
}
</code></pre>

<p>would be great if someone can help me with this. 
many thanks in advance :)</p>
]]></description>
   </item>
   <item>
      <title>Can't get an output!</title>
      <link>https://forum.processing.org/two/discussion/11917/can-t-get-an-output</link>
      <pubDate>Fri, 31 Jul 2015 13:31:23 +0000</pubDate>
      <dc:creator>TheMac</dc:creator>
      <guid isPermaLink="false">11917@/two/discussions</guid>
      <description><![CDATA[<p>I am making an simple encryption machine. You type in a word and it gets encrypted into something unreadable. I have tested it with just an letter and i works, but now that i'm trying to do it with a word, nothing comes out, even do  it's the same code, just modified slightly.</p>

<p>My code:</p>

<pre><code>import controlP5.*;
ControlP5 controlP5;

String headline = "Cryptography machine";
String output = "";
String word = "";
String letter [];
char character;
int mode;
int crypt;
String tempTemp[];


void setup() 
{ 
  size(700,400); 
  background(0); 
  controlP5 = new ControlP5(this);
  PFont font = createFont("arial",20);   

controlP5.addTextfield("plain text")
           .setPosition(20, 100)
           .setSize(500,45)
           .setFont(font)
           .setFocus(true)
           .setColor(color(255,0,0));

controlP5.addTextfield("crypt text")
           .setPosition(550, 100)
           .setSize(45,45)
           .setFont(font)
           .setFocus(true)
           .setColorBackground(color(0,0,255));

controlP5.addButton("Encrypt")
           .setValue(1)
           .setPosition(20,170)
           .setSize(100,19)
           .setColorBackground(color(255, 0, 0));

controlP5.addButton("Decrypt")
           .setValue(2)
           .setPosition(140,170)
           .setSize(100,19)
           .setColorBackground(color(255, 0, 0));

Button reset = controlP5.addButton("Reset")
           .setValue(3)
           .setPosition(260,170)
           .setSize(100,19)
           .setColorBackground(color(255, 0, 0));      

reset.addCallback(new CallbackListener() 
  {
    public void controlEvent(CallbackEvent theEvent) 
    {
      switch(theEvent.getAction()) 
      {
        case(ControlP5.ACTION_PRESSED): mode = 3; break;
        case(ControlP5.ACTION_RELEASED): mode = 0; break;
      }
    }
  }
  );

mode = 0;
}

void draw() 
{
  background(0); 
  fill (255); 
  text(output, 20,300);

// Overskrift.
  textSize(40);
  text(headline, 130, 60);

println(output);
  encryptFunction();

switch(mode)
  {
      case 1: 
        encryptFunction();
        break;
      case 2:
        encryptFunction();
        break;
      case 3:
        resetFunction();
        break;
  }
}

public void Encrypt(int theValue) {
  mode = theValue; 
}

public void Decrypt(int theValue) {
  mode = theValue;  
}

public void encryptFunction()
{
    word = controlP5.get(Textfield.class,"plain text").getText();
    letter = word.split("");
    for(int i = 0; i &lt; letter.length; i++)
    {
        String temp = letter[i];
        try 
        {
            character = temp.charAt(0);
        } 
        catch (StringIndexOutOfBoundsException e) 
        {

        }

        try 
        {
            crypt = Integer.parseInt(controlP5.get(Textfield.class,"crypt text").getText());
        } 
        catch (NumberFormatException e) 
        {

        }

        int ascii = (int) character;
        int xor = ascii ^ crypt;
        char encryptedWordChar = (char) xor;
        String encryptedWord = Character.toString(encryptedWordChar);

        try 
        {
            tempTemp[i] = encryptedWord;
        } 
        catch (NullPointerException e) 
        {

        }

    }
        try 
        {
            output = tempTemp.toString();
        } 
        catch (NullPointerException e) 
        {

        }           
}

public void resetFunction()
{
}
</code></pre>

<p>The encryption is done in the metode - encryption.</p>

<p>Hope some one will help me.</p>
]]></description>
   </item>
   <item>
      <title>Difficulty with nested loop and text</title>
      <link>https://forum.processing.org/two/discussion/11801/difficulty-with-nested-loop-and-text</link>
      <pubDate>Wed, 22 Jul 2015 19:51:27 +0000</pubDate>
      <dc:creator>rumlac</dc:creator>
      <guid isPermaLink="false">11801@/two/discussions</guid>
      <description><![CDATA[<p>Hello, I am trying to figure out how to do the following:</p>

<ul>
<li>Check first character in a string</li>
<li>Check what that character is.</li>
<li>Add 1 to counter (could use an array to store the frequency of each character)</li>
<li>Move on to the next character in the string</li>
<li>and so on..</li>
</ul>

<p>Essentially I am trying to figure out a way of counting the frequency of each different character in a string.</p>

<p>I was able to do this using if/else statements for each letter of the alphabet but ideally I would like a better way of doing this.</p>

<p>Heres what I have so far:</p>

<pre><code>      String yourString = msg;
      char[] allChars = new char[yourString.length()];
      for (int i = 0; i &lt; yourString.length (); i++) {
        allChars[i] = yourString.charAt(i);
        String character = str(allChars[i]);

        for (counter=0; counter &lt; alpha.length; counter++) {
          if (character.equals(alpha[counter]) == true ) {
            count[counter] = count[counter]+1;
          }
        }
      println("The number of A is" + count[0]);
      }
</code></pre>

<p>alpha is a character array containing the individual letters of the alphabet
count is an array where I am trying to store the values i.e:</p>

<ul>
<li>count[0] would equal the number of times the letter A appears in the string</li>
<li>count[1] would equal the number of times the letter B appears in the string</li>
</ul>

<p>Any help would be great! thanks!</p>
]]></description>
   </item>
   <item>
      <title>characters and strings</title>
      <link>https://forum.processing.org/two/discussion/11725/characters-and-strings</link>
      <pubDate>Thu, 16 Jul 2015 14:37:30 +0000</pubDate>
      <dc:creator>allonestring</dc:creator>
      <guid isPermaLink="false">11725@/two/discussions</guid>
      <description><![CDATA[<p>This works fine in java mode, but not in js mode. How can I convert the characters' unicode values back to the actual letters/numbers?</p>

<pre><code>String theLetters = "Hello!";

void setup()
{
  size(400, 400);
}

void draw()
{
  translate(10, height/2);
  for (int i = 0; i &lt; theLetters.length(); i++)
  {
    char thisLetter = theLetters.charAt(i);

    text(thisLetter, 0, 0);
    translate(textWidth(thisLetter), 0);
  }
}

void keyPressed()
{
  if (key != CODED) theLetters += key;
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Hey folks, i want different colors at every branch of my tree. But why does it flicker all the time?</title>
      <link>https://forum.processing.org/two/discussion/11339/hey-folks-i-want-different-colors-at-every-branch-of-my-tree-but-why-does-it-flicker-all-the-time</link>
      <pubDate>Mon, 15 Jun 2015 18:37:33 +0000</pubDate>
      <dc:creator>Chester619</dc:creator>
      <guid isPermaLink="false">11339@/two/discussions</guid>
      <description><![CDATA[<p>I want to set one random color, for every branch. But why the hell ist there always a new color for every branch. want to stop it. Hope you can help me :) see the random action at void(linie)</p>

<pre><code>String Axiom="FL";                      //"FX"
String ER="F&lt;F-[F^&gt;&gt;-F+F]+[&gt;&amp;+F-FL]";   //"FF-[F^-F+FL]+[&gt;&amp;+F-FL]"
String ER2="F&amp;F+&lt;[F&gt;&lt;[&gt;+F]]+&amp;[F&lt;^&amp;--FL]";  //"FF+[F&amp;&gt;+FL]+[F&lt;^-FL]"
String NeuER="";   
String Zwsp=""; 


void setup() {
  size(1200, 1000, P3D);
  smooth(); 
  strokeWeight(0.8);
  frameRate(300);
  for (int a=0; a&lt;=5; a++) {
    if (a==0) {
      NeuER=NeuER+Axiom; 
    } else {
      for (int b=0; b&lt;NeuER.length(); b++) {
        if (NeuER.charAt(b)=='F') {
          Zwsp=Zwsp + ER;
        } else if (NeuER.charAt(b)=='X') {
          Zwsp=Zwsp + ER2;
        } else {
          Zwsp=Zwsp + NeuER.charAt(b);
        }     
      }
      NeuER=Zwsp;   
      Zwsp="";
    }
  }
  print(NeuER);

}

void linie(float x2, float y2, float z2) {

  stroke(random(255), random(255), random(255));

  //if (mousePressed &amp;&amp; (mouseButton == LEFT)) {
    //stroke(0, 0, 0, 0);
  //}

  line(0, 0, 0, x2, y2, z2);
  translate(x2, y2, z2);

}

void kreis (float x3, float y3, float z3 ) {
  fill(127, 4, 4);
   if (keyPressed &amp;&amp; (key == 's')) {
    fill(255, 64,64);
  }
  //fill(random(100,150),random(200),random(40),200);
   if (keyPressed &amp;&amp; (key == 'a')) {
     fill(238,238,0);
   }
   if (keyPressed &amp;&amp; (key == 'd')) {
     fill(51,51,255);
   }
  noStroke();
  lights();
  translate(x3, y3, z3);
  sphere(2);
}



void rechts() {
  rotateZ(radians(25));
}

void links() {
  rotateZ(-(radians(25)));
}
void posMerk() {
  pushMatrix();
}

void posZrks() {
  popMatrix(); 
}

void vorKippen() {
  rotateX(radians(25));
}

void rueckKippen() {
  rotateX(-(radians(25)));
}

void vorRollen() {
  rotateY(radians(25));
}

void rueckRollen() {
  rotateY(-(radians(25)));
}

void PB() {
  rotate(PI*0.3);
}

void MB() {
  rotate(-(PI*(0.23)));
}

void draw() {
  sphereDetail(5);
  translate (640,980, 0);
  background(191,239,255,0); 
  if((mousePressed &amp;&amp; (mouseButton == RIGHT))) {
    rotateX(radians(mouseX));
  }
  rotateY(radians(mouseX));
  float zoom = map(mouseY, 0, height, 0.1, 4);
  scale(zoom);
  linie(0, -20, 0);    //"Stamm" des Baum
  for (int i=0; i&lt;NeuER.length(); i++) {
    if (NeuER.charAt(i)=='F') {
      linie(0, -8, 0);   //random(-100)    
     } else if (NeuER.charAt(i)=='[') {
      posMerk(); 
     } else if (NeuER.charAt(i)==']') { 
      posZrks(); 
     } else if (NeuER.charAt(i)=='-') {
      links();
     } else if (NeuER.charAt(i)=='+') {
      rechts(); 
     } else if (NeuER.charAt(i)=='&amp;') {
      vorKippen();
     } else if (NeuER.charAt(i)=='^') {
      rueckKippen();
     } else if (NeuER.charAt(i)=='&lt;') {
      vorRollen();
     } else if (NeuER.charAt(i)=='&gt;') {
      rueckRollen();
     } else if (NeuER.charAt(i)=='L') {
      //scale(random(0.9,1.8));
      kreis(0, 0, 0);
     }
  }
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Count Comma's from a String</title>
      <link>https://forum.processing.org/two/discussion/10151/count-comma-s-from-a-string</link>
      <pubDate>Thu, 02 Apr 2015 14:10:32 +0000</pubDate>
      <dc:creator>fahadkalis</dc:creator>
      <guid isPermaLink="false">10151@/two/discussions</guid>
      <description><![CDATA[<p>Hi, 
Do I know which command in Processing will allow me to count comma's from a string?</p>
]]></description>
   </item>
   <item>
      <title>println if a string contains a certain character only once</title>
      <link>https://forum.processing.org/two/discussion/8066/println-if-a-string-contains-a-certain-character-only-once</link>
      <pubDate>Tue, 11 Nov 2014 07:03:16 +0000</pubDate>
      <dc:creator>anderssonx</dc:creator>
      <guid isPermaLink="false">8066@/two/discussions</guid>
      <description><![CDATA[<p>I'm trying to code a program to check a string for a certain character and if it's found once (but not less or more than one)in the string i want to print a line to the command box.</p>

<p>How can i achieve this?</p>
]]></description>
   </item>
   </channel>
</rss>