// Includes, namespace and prototypes
#include "template.h"
//using namespace std;
using namespace AGK;
app App;
// Begin app, called once at the start
void app::Begin( void )
{
how="how are you?";
howt="how are you today?";
color="what is your favorite color?";
sz="a";
spot=0;
timing=0;
agk::SetDisplayAspect(-1);
agk::StartTextInput();
}
// Main loop, called every frame
void app::Loop ( void )
{
if (timing==0){
agk::Print ("Hello! Ask me anything you'd like and I'll try to answer it! Plz type in lowercase letters only :)");}
if (timing==1){
agk::StartTextInput ();}
if ((timing==1)||(timing==0)){
if (agk::GetTextInputCompleted()){
timing=1;
sz=agk::GetTextInput();
}
if ((strcmp(sz,how)==0)||(strcmp(sz,howt)==0)){
agk::Print ("Very well thank you!");}
if (strcmp(sz,color)==0){
agk::Print ("Purple");}
}
agk::Sync();
}
// Called when the app ends
void app::End ( void )
{
}
I'm using tier 2 android. It's driving me mad
After the first input I do it works fine, then when I try a second time for the other question the same thing prints, like sz doesn't change.
This is supposed to be a siri sort of thing. Thanks in advance for the help!
strcmp compares the two strings.