d2jsp
Log InRegister
d2jsp Forums > Other Games > Archived Games > Heroes of Newerth > General Hon Chat
Prev1190019011902190319043161Next
Add Reply New Topic New Poll
Member
Posts: 20,716
Joined: Jul 9 2007
Gold: 0.51
Nov 6 2011 01:42pm
Quote (dude150 @ Nov 6 2011 03:41pm)
i have a saitek eclipse II
mechanical keyboards dominate rubber dome, no question about it



I am useless.........


HOW DO I TURN INTEGER # TO A CHARACTER LIKE A???
Member
Posts: 61,418
Joined: Nov 21 2006
Gold: Locked
Nov 6 2011 01:49pm
Quote (garbo @ 6 Nov 2011 14:42)
HOW DO I TURN INTEGER # TO A CHARACTER LIKE A???


wat
for that program you didn't need to "turn it" into a char, just return a different char based on the int value
my program should have worked but maybe it was a diff version of fortran
Member
Posts: 20,716
Joined: Jul 9 2007
Gold: 0.51
Nov 6 2011 01:56pm
Quote (Ectasy @ Nov 6 2011 03:49pm)
wat
for that program you didn't need to "turn it" into a char, just return a different char based on the int value
my program should have worked but maybe it was a diff version of fortran


heres the error i get

assigning a character expression to an integer value is not allowed

and i forgot what you sent me, i deleted it like a nub

was it

= char(A) ?

This post was edited by garbo on Nov 6 2011 01:56pm
Member
Posts: 6,777
Joined: Jun 30 2008
Gold: 1,110.60
Nov 6 2011 02:00pm
Quote (garbo @ Nov 6 2011 03:56pm)
heres the error i get

assigning a character expression to an integer value is not allowed


are you doing something like int a = char b??
are you trying to switch an int to a char/string straight up or are you trying to deal with a character based on its lexicographic ASCII-based value?
Member
Posts: 20,716
Joined: Jul 9 2007
Gold: 0.51
Nov 6 2011 02:01pm
Quote (dude150 @ Nov 6 2011 04:00pm)
are you doing something like int a = char b??
are you trying to switch an int to a char/string straight up or are you trying to deal with a character based on its lexicographic ASCII-based value?


yes integer so a grade # into a grade letter
Member
Posts: 61,418
Joined: Nov 21 2006
Gold: Locked
Nov 6 2011 02:06pm
Quote (garbo @ 6 Nov 2011 14:56)
heres the error i get

assigning a character expression to an integer value is not allowed

and i forgot what you sent me, i deleted it like a nub

was it

= char(A) ?


thats odd, shouldnt have gotten an error like that.. you weren't assigning a char value to an int variable
Member
Posts: 20,716
Joined: Jul 9 2007
Gold: 0.51
Nov 6 2011 02:07pm
Quote (Ectasy @ Nov 6 2011 04:06pm)
thats odd, shouldnt have gotten an error like that.. you weren't assigning a char value to an int variable


number grade from 0-100 to A,b,c,d,f

pretty much i need to assign

0-59 to F
60-69 to D
70-79 to C
80-89 to B
90-100 to A

This post was edited by garbo on Nov 6 2011 02:18pm
Member
Posts: 6,777
Joined: Jun 30 2008
Gold: 1,110.60
Nov 6 2011 02:30pm
Quote (garbo @ Nov 6 2011 04:07pm)
number grade from 0-100 to A,b,c,d,f

pretty much i need to assign

0-59 to F
60-69 to D
70-79 to C
80-89 to B
90-100 to A


you need to assign the whole range of values to the letter?
what exactly are you doing?

you could have an array for each grade to contain the entire range of values and then check each letter grade for the percentage grade that you receive

or you could just umbrella some if statements like:

Code

if(grade < 59)
print('F');

else if(grade<69)
print('D');

else if(grade <

etc etc
Member
Posts: 20,716
Joined: Jul 9 2007
Gold: 0.51
Nov 6 2011 02:33pm
its structured in a case construct which is in a function
Member
Posts: 61,418
Joined: Nov 21 2006
Gold: Locked
Nov 6 2011 02:33pm
it needs to return son
plus its in fortran so its odd
Go Back To Heroes of Newerth Topic List
Prev1190019011902190319043161Next
Add Reply New Topic New Poll