I'm attempting to create a small program that takes a small paragraph as input, identifies how often each letter is used, and then displays the alphabet with correlating font sizes.
In the loop I created to enumerate the number of appearences for each letter, I'm getting an error message that says "expecting LPAREN, found 'para', and it highlights this line of code:
if para[i] == 'a' {
Does anyone have any ideas? Your help would be much appreciated.
Here is the entirety of the code so far:
_______________________________________________
import interfascia.*;
GUIController c;
IFTextField t;
IFLabel l;
IFLookAndFeel theLook;
PFont f;
String paragraph;
char[] para = new char[29];
int[] lsizes;
int top;
void setup() {
size(900, 450);
f = loadFont("TrebuchetMS-48.vlw");
background(0);
theLook = new IFLookAndFeel(this, IFLookAndFeel.DEFAULT);
theLook.textColor = color(255, 255, 255);
paragraph = "";
c = new GUIController(this);
t = new IFTextField("Text Field", 325, 360, 250);
l = new IFLabel("Please input a short paragraph and press enter.", 328, 400);
c.add(t);
c.add(l);
c.setLookAndFeel(theLook);
t.addActionListener(this);
}
void draw() {
fill(255);
textFont(f);
}
void actionPerformed(GUIEvent e) {
if (e.getMessage().equals("Completed")) {
paragraph = t.getValue();
para = paragraph.toCharArray();
para.toLowerCase();
//*set all values in lsizes[] to 0*//
//*run through array to check for number of times for each letter*//