code translation - Small Basic Arrays to C# -
i hate arrays! have no idea how create them or use them :/
so wonder if me...
i've got basic understanding of arrays in small basic i'm learning @ school @ moment small basic limits on can since it's such high level language.
i'm making conjugator verbs in spanish using strings , arrays..
could , translate small basic code c#?
here code:
irrverbpreterit["ser"] = "ser" irrverbpreterit["ser"]["verb1stpreterit"] = "fui" irrverbpreterit["ser"]["verb2ndpreterit"] = "fuiste" irrverbpreterit["ser"]["verb3rdpreterit"] = "fue" irrverbpreterit["ser"]["verb4thpreterit"] = "fuimos" irrverbpreterit["ser"]["verb5thpreterit"] = "fuisteis" irrverbpreterit["ser"]["verb6thpreterit"] = "fueron"
also how see if verb in array? in small basic have...
if(array.containsindex(irrverbpresent, verb))
would great if me this!
kind regards, ~ben
i create verb class make things easy:
class verb { public string infinitive; public string verb1stpreterit; public string verb2ndpreterit; public string verb3rdpreterit; ..... } //this class substitutes array's second coordinate, making lot easier understand code.
could use that:
verb ser = new verb(); ser.infinitive = "ser"; ser.verb1stpreterit = "fui"; .... verb estar = new verb(); estar.infinitive = "estar"; estar.verb1stpreterit = "estive"; ....
then have dictionary:
dictionary<string, verb> verbs = new dictionary<string, verb>(); verbs.add(ser.infinitive, ser); //this substitute arrays first dimension. verbs.add(estar.infinitive, estar); verbs infinitive.
Comments
Post a Comment