Results 21 to 40 of 58
- 06-11-2010, 01:19 AM #21
Senior Member
- Join Date
- Feb 2010
- Location
- Waterford, Ireland
- Posts
- 748
- Rep Power
- 4
Generate an alphabet
study this code and understand how it works....then I will get back to you
run this in a main programme by itself and have a function print out the contents of alphabet array, and ask yourself how you think it works, then come back and ask questions, dont go too far ahead of yourselfJava Code:char [] alphabet=new char[26]; alphabet[0]='a'; // fill up alphabet with the 26 letters of the alphabet for(int i=1;i<alphabet.length;i++) { alphabet[i]=(char) (alphabet[i-1]+1); }
- 06-11-2010, 04:24 PM #22
Member
- Join Date
- May 2010
- Location
- Singapore
- Posts
- 31
- Rep Power
- 0
How this function works ..
It would generate and print out all 26 alphabets.
What does this do ... i minus 1 then plus one again?(alphabet[i-1]+1);
:confused:
- 06-11-2010, 04:59 PM #23
Member
- Join Date
- Jun 2010
- Posts
- 9
- Rep Power
- 0
- 06-11-2010, 05:24 PM #24
Member
- Join Date
- May 2010
- Location
- Singapore
- Posts
- 31
- Rep Power
- 0
Thanks
Oh. oh ok.
Thanks ... didn't relate the ' i ' back with "for(int i=1;i<alphabet.length;i++)", no wonder i was wondering why i would subtract and add one unknowingly, ok, i got it .. little mistake in the understanding there.
Thanks again Anandt88 !!
- 06-11-2010, 05:31 PM #25
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
- 06-11-2010, 05:46 PM #26
Member
- Join Date
- May 2010
- Location
- Singapore
- Posts
- 31
- Rep Power
- 0
So what's next Al_marshy_81?
- 06-13-2010, 04:36 PM #27
Member
- Join Date
- May 2010
- Location
- Singapore
- Posts
- 31
- Rep Power
- 0
There's some problems with my codes and need more help and improvements - READ MORE!
There's some problems with my codes ... and require more help and improvements to the codes as many features are missing from the game ....
This is the class i created for the introduction : (BELOW)
This is the code I've created for Game Instructions :Java Code:public class Intro { public String Intro; public Intro(String Intro) { Intro = Intro; [COLOR="Blue"]//[=====================[INTRODUCTION PANEL]========================================================][/COLOR] System.out.println(" Welcome to the FindYourLettersGame "); System.out.println("Done by Poisson"); [COLOR="Blue"]//[==================================================================================================][/COLOR] }
This is my overall codes : (Right Below)Java Code:public class GameInstructions { public String GameInstructions; public GameInstructions(String GameInstructions) { GameInstructions = GameInstructions; [COLOR="Blue"]//[================================================================================================] //This will display the Rules Of The Game[/COLOR] System.out.println("[==================[HOW TO PLAY]==========================================]"); System.out.println("- This is a 2 player FindYourWords game!!!"); System.out.println("- Each Player will be provided with 10 random letters with at least 2 vowels"); System.out.println("- Each Player will take turns to enter their word using the 10 Random Letters provided To Them ONLY!!"); System.out.println("- The entered word will be checked for its validity, and the Player can try again if He/She enters a valid word"); System.out.println("unless The Player Want To Pass Their Turn"); System.out.println("- If the player decides to pass, Player 2 will be next to enter in their word"); System.out.println("- Game will continue for as many rounds unless a player quit the game"); System.out.println("- The scores will be displayed at the end of the game"); System.out.println("- The Player with the highest scores will win the game!"); System.out.println(" "); System.out.println("[========================================================================]"); [COLOR="Blue"]// End Of the Rules Of The Game //[==================================================================================================][/COLOR] } }
Ok, I know how to generate 10 random alphabets with at least 2 vowelsJava Code:import java.io import java.util.Scanner; import java.util.Random; public class FindYourLettersGame { public static void main(String[] args) { [COLOR="Blue"]//[=====================[INTRODUCTION PANEL]========================================================] //This will display the introduction[/COLOR] FindYourLettersGame Intro = new FindYourLettersGame(); [COLOR="Blue"]//[==================================================================================================] //[=====================[INITIALISE RANDOM]==========================================================][/COLOR] Random randomPlay = new Random(); Scanner scan = new Scanner(System.in); [COLOR="Blue"]//[==================================================================================================] //This will display the Instructions Of The Game[/COLOR] FindYourLettersGame GameInstructions = new FindYourLettersGame(); [COLOR="Blue"]//[=====================[CHECKS LETTERS FOR ITS EXISTENCE IN THE "WORDS.TXT"]========================] [/COLOR] String wordLog[] = FileUtil.readDictFromFile("words.txt"); [COLOR="Blue"]//[==================================================================================================] //[=====================[DECLARE ALL THE REQUIRED VARIABLES FOR THE FINDYOURLETTERS GAME]============] //Array for letters, array for assigned letters score and array for vowels[/COLOR] char[] Letters = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}; int [] alphaScore = {1,3,3,2,1,4,2,4,1,8,5,1,3,1,1,3,10,1,1,1,1,4,4,8,4,10}; char[] vowelsFive = {'A', 'E', 'I', 'O', 'U'}; [COLOR="Blue"]//This is to assign the letters and place it within numbers of 10 ===========================][/COLOR] char[] shuffleLetters = new char[10]; int[] randomDigit = new int[31]; [COLOR="Blue"]//Initialise playerName input[/COLOR] String playerName = null; [COLOR="Blue"]//Initialise index/position of the elements in the array[/COLOR] int index; [COLOR="Blue"]//Initialise wordInput[/COLOR] String wordInput = null; [COLOR="Blue"]//Initialise word's score[/COLOR] int score4Word = 0; [COLOR="Blue"]//Initialise player's score[/COLOR] int score4Player = 0; [COLOR="Blue"]//Initialise pass and quit[/COLOR] int decides2Pass = @; int decides2Quit = !; [COLOR="Blue"]//[================================================================================================][/COLOR] [COLOR="Blue"]//[==================================================================================================] //[=====================[PRINTS OUT "FINDYOURLETTERS" AND "LETTERS FOR PLAYER"]======================][/COLOR] System.out.println("FindYourLetters"); [COLOR="Blue"]//Player will be able to enter their name to be refer as in the game=====================][/COLOR] System.out.print("Enter your name: "); playerName = scan.nextLine(); [COLOR="Blue"]//Prints out statement "Letters for{the name the player entered earlier}:"===============][/COLOR] System.out.print("Letters for " + (playerName) +": "); [COLOR="Blue"]//[==================================================================================================] //[=====================[POOL OF 10 RANDOM LETTERS WITH AT LEAST 2 VOWELS]===========================] //Ensure that there are at least 2 vowels in the generated words[/COLOR] for (int k = 0; k < 2; k++){ index = randomPlay.nextInt(vowelsFive.length); shuffleLetters[k] = vowelsFive[index]; } [COLOR="Blue"]//This would produce the ten random letters it's supposed to //This is to initialise "i" and i is less than the length of shuffleLetter and the iterator[/COLOR] for (int i = 0; i < shuffleLetters.length; i++) { int xx = randomPlay.nextInt(alphaArray.length); [COLOR="Blue"]//Check whether the above code works[/COLOR] if (shuffleLetters[i] == '\u0000') { shuffleLetters[i] = alphaArray[xx]; } [COLOR="Blue"]//This would print out the letters and I added the function //Whereby the comma would be printed out for every letter //until the last letter where there would not be any comma[/COLOR] System.out.print(shuffleLetters[i]+ ((i < 9) ? ", " : " " )); } [COLOR="Blue"]//[==================================================================================================] //[=====================[PASS OR QUIT - PLAYER'S CHOICE]=============================================] //Objective Of wordCheck is to count for how many letters in player's input //is the same as the given letters[/COLOR] int wordCheck = 0; int dictCount = 0; [COLOR="Blue"]//Total score for word after checking[/COLOR] score4Word = 0; score4Player = 0; System.out.println(""); System.out.print("Enter your word (or ‘@’ to pass or ‘!’ to quit): " + (wordInput)+ ""); wordInput = scan.nextLine(); wordInput = wordInput.toUpperCase(); [COLOR="Blue"]//This is a For loop to count the no. of letters in player's input //is the same as the given letter[/COLOR] for (int zero =0; zero<wordInput.length(); zero++){ for (int g =0; g<shuffleLetters.length; g++){ if (wordInput.charAt(zero) == shuffleLetters[g]){ wordCheck += 1; break; } } }[COLOR="Blue"] // End Of Loop[/COLOR] System.out.println("Total score for word " +": " + score4Word); System.out.println("Total score for " + (playerName) +": " + score4Player); [COLOR="Blue"]//[==================================================================================================][/COLOR] } }
Do not know how to create the part where 2 players can play such as :
This is the code which I've created to assign scores to those letters, it's a switch statements :if (playersTurn == true)
System.out.println("Letters of player" + playerName + ": " + lettersGiven);
else
System.out.println("Letters of player + playerName + ": " + lettersGiven);
This is the code I've created to decides who win ... all of this codes above are not yet insert into the main code as it would mess it up ... just putting the pieces of different functions together :Java Code:int wordLength = 0; int score = 0; [COLOR="Blue"]//returns integer[/COLOR] wordLength = inputWord.length(); [COLOR="Blue"]//perLetter[0] = 'a';[/COLOR] char[] perLetter = inputWord.toUpperCase().toCharArray(); for (int i = 0 ; i < wordLength; i++) { [COLOR="Blue"]//convert the letter to upperCase[/COLOR] switch (perLetter[i]) { [COLOR="Blue"]// Letters with score = 1[/COLOR] case 'A': case 'E': case 'I': case 'O': case 'U': score = score + 1; break; case 'L': case 'N': case 'R': case 'S': case 'T': score = score + 1; break; [COLOR="Blue"]// Letters with score = 2[/COLOR] case 'D': case 'G': score = score + 2; break; [COLOR="Blue"]// Letters with score = 3[/COLOR] case 'B': case 'C': case 'M': case 'P' : score = score + 3; break; [COLOR="Blue"]// Letters with score = 5[/COLOR] case 'K': score = score + 5; break; [COLOR="Blue"]// Letters with score = 4[/COLOR] case 'F': case 'H': case 'V': case 'W': case 'Y': score = score + 4; break; [COLOR="Blue"]// Letters with score = 8[/COLOR] case 'J': case 'X': score = score + 8; break; [COLOR="Blue"]// Letters with score = 10[/COLOR] case 'Q': case 'Z': score = score + 10; break; default: break; }/**/ }
Java Code:[COLOR="Blue"]//Initialise winner[/COLOR] String winner = ""; if (score1 > score2) winner = "Player 1 has won!"; if (score2 > score1) winner = "Player 2 has won!"; if (score1 == score2) winner = "It is a Draw for both players."; winner = "Total Score of Player 1: " + score1 + "\n" + "Total Score of Player 2: " + score2 + "\n" + winner; return winner; }
:mad:I asked this question some 2 weeks ago ... tried to asked more abt what the codes other users posted meant as I'm still learning Java bit by bit, but to no avail ... deadline's tmr, not much time ... so I just want to get some features of the game done, so as not to get that bad of a grade.
:confused: :( :confused:
- 06-13-2010, 05:34 PM #28
Comment on the default: in switch. Do you ever expect it to be called? If not add a println() to say that was called and with what value. That would show a logic problem since you never expected it.
- 06-13-2010, 06:07 PM #29
Member
- Join Date
- May 2010
- Location
- Singapore
- Posts
- 31
- Rep Power
- 0
Abt the switch statement, thx!
like this?Java Code:[COLOR="Blue"]//If it does not match any case ...[/COLOR] default: System.out.println("Invalid"); break; }
:) thx
- 06-13-2010, 07:53 PM #30
Almost. Better if you show what's wrong:
System.out.println("Invalid: " + perLetter[i]);
- 06-14-2010, 05:21 AM #31
Member
- Join Date
- May 2010
- Location
- Singapore
- Posts
- 31
- Rep Power
- 0
oh, forgot that too, hehe, thanks Norm!
ok, thx, forgotten abt the error! thx!!Java Code:default : System.out.println("Invalid" + perLetter[i]););
;)
- 06-14-2010, 10:49 AM #32
Member
- Join Date
- May 2010
- Location
- Singapore
- Posts
- 31
- Rep Power
- 0
The classes of Intro and GameInstructions does not print out
The part where :Java Code:import java.io import java.util.Scanner; import java.util.Random; public class FindYourLettersGame { public static void main(String[] args) { //[=====================[INTRODUCTION PANEL]========================================================] //This will display the introduction FindYourLettersGame Intro = new FindYourLettersGame(); //[==================================================================================================] //[=====================[INITIALISE RANDOM]==========================================================] Random randomPlay = new Random(); Scanner scan = new Scanner(System.in); //[==================================================================================================] //This will display the Instructions Of The Game FindYourLettersGame GameInstructions = new FindYourLettersGame(); //[=====================[CHECKS LETTERS FOR ITS EXISTENCE IN THE "WORDS.TXT"]========================] String wordLog[] = FileUtil.readDictFromFile("words.txt"); //[==================================================================================================]
and ://This will display the introduction
FindYourLettersGame Intro = new FindYourLettersGame();
could not be printed out, what's my problem?//This will display the Instructions Of The Game
FindYourLettersGame GameInstructions = new GameInstructions();
I've created the various classes for Intro and GameInstructions from my previous posted reply ...
My deadline's in 5 hours time b4 i submit my full codes, soo
Any idea?
- 06-14-2010, 04:11 PM #33
Member
- Join Date
- May 2010
- Location
- Singapore
- Posts
- 31
- Rep Power
- 0
I want to create a method 4 getting the 10 random letters but there's problem,help?!!
This is the method that I think I've created , but it states that GetShuffleLetters cannot resolved to a type and the String is "Syntax or token "String", @ expected ...Java Code:private static String GetShuffleLetters() { [COLOR="Blue"]// TODO Auto-generated method stub[/COLOR] [COLOR="Blue"]//Code to display random letters //Ensure that there are at least 2 vowels in the generated words[/COLOR] for (int k = 0; k < 2; k++){ index = randomGen.nextInt(Vowels.length); shuffleLetter[k] = Vowels[index]; } [COLOR="Blue"]//This would produce the ten random letters it's supposed to //This is to initialise "i" and i is less than the length of shuffleLetter and the iterator[/COLOR] for (int i = 0; i < shuffleLetter.length; i++) { int xx = randomGen.nextInt(alphaArray.length); [COLOR="Blue"]//Check whether the above code works[/COLOR] if (shuffleLetter[i] == '\u0000') { shuffleLetter[i] = alphaArray[xx]; } [COLOR="Blue"]//This would print out the letters and I added the function //Whereby the comma would be printed out for every letter //until the last letter where there would not be any comma[/COLOR] System.out.print(shuffleLetter[i]+ ((i < 9) ? ", " : " " )); } }return GetShuffleLetters; } return null; } }
I'm not good with methods and constructors, anyone have any idea?!!!
This is my overall code in my Java Eclipse and Notepad++, i wanted to place the method below and it would act as a shortcut in the while loop :Java Code:import java.io.InputStreamReader; import java.io.BufferedReader; import java.util.Random; import java.util.Scanner; public class FindYourLettersGame{ public static void main(String[] args) { [COLOR="Blue"]//[=====================[INTRODUCTION PANEL]========================================================][/COLOR] FindYourLettersGame Intro = new FindYourLettersGame(); System.out.println(Intro); [COLOR="Blue"]//[==================================================================================================] //[=====================[INITIALISE RANDOM]==========================================================][/COLOR] Random randomGen = new Random(); Scanner scan = new Scanner(System.in); [COLOR="Blue"]//[==================================================================================================][/COLOR] [COLOR="Blue"]//[=====================[CHECKS LETTERS FOR ITS EXISTENCE IN THE "WORDS.TXT"]========================] [/COLOR] String wordLog[] = FileUtil.readDictFromFile("words.txt"); [COLOR="Blue"]//[==================================================================================================] //[=====================[ARRAY FOR LETTERS, ARRAY FOR ASSIGNED LETTER SCORE AND VOWELS]==============][/COLOR] char [] alphaArray = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; int [] alphaScore = {1,3,3,2,1,4,2,4,1,8,5,1,3,1,1,3,10,1,1,1,1,4,4,8,4,10}; char[] Vowels = {'a', 'e', 'i', 'o', 'u'}; [COLOR="Blue"]//This is to assign the letters and place it within numbers of 10 ===========================][/COLOR] char[] shuffleLetter = new char[10]; int[] randomInteger = new int[31]; [COLOR="Blue"]//Initialise playerName and playerName2 input // in order to get "Letters for Player "playerName": vice versa[/COLOR] String playerName = null; String playerName2 = null; [COLOR="Blue"]//Initialise index/position of the elements in the array[/COLOR] int index; [COLOR="Blue"]//Initialise choice Input[/COLOR] int choice = 0; [COLOR="Blue"]//Initialise wordInput[/COLOR] String wordInput = "&"; [COLOR="Blue"]//Initialise the boolean to check word validity, make valid equals to false first[/COLOR] boolean valid = false; [COLOR="Blue"]//Initialise InputStreamReader to covert bytes into character stream[/COLOR] InputStreamReader input = new InputStreamReader(System.in); [COLOR="Blue"]//InputStreamReader is being wrapped in here == Reads text from char stream[/COLOR] BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); [COLOR="Blue"]//[==================================================================================================][/COLOR] [COLOR="Blue"]//While comparing the wordInput to quit or not ...[/COLOR] while (wordInput.compareTo("!") > 0) { [COLOR="Blue"]// Get the random letters[/COLOR] wordInput = getshuffleLetters(); [COLOR="Blue"]//try and catch[/COLOR] try { [COLOR="Blue"]// Menu to select what do the players want to do[/COLOR] System.out.println("Menu :"); System.out.println("\t9 - Enter your names"); System.out.println("\t8 - Continue! ^______^"); System.out.println("\t@ - Pass ^______^"); System.out.println("\t! - Exit -_-"); [COLOR="Blue"]//Prompts user to enter their choice[/COLOR] System.out.println("Please enter your choice : "); choice = scan.nextInt(); if (choice == 9) { [COLOR="Blue"]// Choice 1 actions displays! //enter name[/COLOR] System.out.println("Enter your name: "); playerName=scan.nextLine(); [COLOR="Blue"]//Do not know how to make it such that //Player one types first then followed by //Player two ... damn >.<[/COLOR] System.out.println("Enter your name: "); playerName2=scan.nextLine(); } else if (choice == '@') { continue; } else if (choice == '!') { [COLOR="Blue"]// Option 'Exit' actions here[/COLOR] System.out.println("You have chosen to exit.\nThe game will exit now."); } else if (choice != 9 || choice != 8 || choice != '@'|| choice != '!') { [COLOR="Blue"]// Invalid option[/COLOR] System.out.println("**Invalid choice, please choose again.**"); } else { } if (choice == 8) { // Choice 2 actions displays! System.out.println("Letters for player " +(playerName)+ ": " +shuffleLetter); } else { System.out.println("Letters for player " +(playerName2)+ ": " +shuffleLetter); } [COLOR="Blue"]//To stop=========================================================+[/COLOR] break; } catch (Exception e) { [COLOR="Blue"]// catch \n of the scan error exception===============================+[/COLOR] String junk = scan.nextLine(); System.out.println(" ** ERROR!!! There's no such choice. ** "); System.out.println(" ** Please try again!!! ** "); } [COLOR="Blue"]//[=====================[PRINTS OUT "FINDYOURLETTERS" AND "LETTERS FOR PLAYER"]======================][/COLOR] System.out.println("FindYourLetters"); [COLOR="Blue"]//[==================================================================================================] //[=====================[POOL OF 10 RANDOM LETTERS!!!]===============================================] //[==================================================================================================] //[=====================[PASS OR QUIT - PLAYER'S CHOICE]=============================================][/COLOR] System.out.println(""); System.out.println("Enter your word (or ‘@’ to pass or ‘!’ to quit): "); [COLOR="Blue"]//[==================================================================================================][/COLOR] private static String getshuffleLetters() { // TODO Auto-generated method stub [COLOR="Blue"]//Code to display random letters //Ensure that there are at least 2 vowels in the generated words[/COLOR] for (int k = 0; k < 2; k++){ index = randomGen.nextInt(Vowels.length); shuffleLetter[k] = Vowels[index]; } [COLOR="Blue"]//This would produce the ten random letters it's supposed to //This is to initialise "i" and i is less than the length of shuffleLetter and the iterator[/COLOR] for (int i = 0; i < shuffleLetter.length; i++) { int xx = randomGen.nextInt(alphaArray.length); //Check whether the above code works if (shuffleLetter[i] == '\u0000') { shuffleLetter[i] = alphaArray[xx]; } [COLOR="Blue"]//This would print out the letters and I added the function //Whereby the comma would be printed out for every letter //until the last letter where there would not be any comma[/COLOR] System.out.print(shuffleLetter[i]+ ((i < 9) ? ", " : " " )); } }return getshuffleLetters; } } }
Errors I received from the above overall codes ...while (wordInput.compareTo("!") > 0) {
wordInput = GetShuffleLetters();
try { ...
I'm terribly suck in Java, still determined to get the answer even after submitting it in half hour's time and how to improve my codes further even though my Java project is expected to get a "Fail" this week ... =_= at least gave my best shot at it, feels good :)Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The method getshuffleLetters() is undefined for the type FindYourLettersGame
Syntax error on token "String", @ expected
getshuffleLetters cannot be resolved to a type
Syntax error, insert "enum Identifier" to complete EnumHeaderName
Syntax error, insert "EnumBody" to complete BlockStatement
at FindYourLettersGame.main(FindYourLettersGame.java: 55)
:(:(:(Last edited by poisson; 06-14-2010 at 04:16 PM. Reason: Forgot some codes
- 06-14-2010, 04:29 PM #34
Sorry, I'm not familiar with the program that generates the error messages you've posted.
When I use javac and have errors I get:
These have the line number and shows the source line itself with the error.angMan2.java:193: cannot find symbol
symbol : variable val
location: class HangMan2
obj.method(val);
^
HangMan2.java:193: cannot find symbol
symbol : variable obj
location: class HangMan2
obj.method(val);
^
HangMan2.java:194: cannot find symbol
symbol : variable val
location: class HangMan2
val = 22;
^
HangMan2.java:7: warning: [serial] serializable class HangMan2 has no definition of serialVersionUID
public class HangMan2 extends JFrame implements ActionListener{
^
3 errors
1 warning
Your error messages appear to have been edited.
- 06-14-2010, 05:00 PM #35
Member
- Join Date
- May 2010
- Location
- Singapore
- Posts
- 31
- Rep Power
- 0
Ok, i will look into that matter.
Ok, i will look into that matter first, hehe.These have the line number and shows the source line itself with the error.angMan2.java:193: cannot find symbol
symbol : variable val
location: class HangMan2
obj.method(val);
^
HangMan2.java:193: cannot find symbol
symbol : variable obj
location: class HangMan2
obj.method(val);
^
HangMan2.java:194: cannot find symbol
symbol : variable val
location: class HangMan2
val = 22;
^
HangMan2.java:7: warning: [serial] serializable class HangMan2 has no definition of serialVersionUID
public class HangMan2 extends JFrame implements ActionListener{
^
3 errors
1 warning
Your error messages appear to have been edited.
- 06-18-2010, 03:16 AM #36
Senior Member
- Join Date
- Feb 2010
- Location
- Waterford, Ireland
- Posts
- 748
- Rep Power
- 4
- 06-18-2010, 03:23 AM #37
Senior Member
- Join Date
- Feb 2010
- Location
- Waterford, Ireland
- Posts
- 748
- Rep Power
- 4
Poisson if you have a function that generates 26 letters of the alphabet, good. now you need to assign scores to each letter, how do you think you will accomplish this? think a class to store scoring information
- 06-18-2010, 06:56 AM #38
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
- 06-18-2010, 12:48 PM #39
Never heard that term. I coded fortran years ago and don't get the connection. Is it something that they teach in school in a negative way?Your code is just Fortranesque
Could you elaborate please.
Thanks.
- 06-18-2010, 01:11 PM #40
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
Yep, you have that right; the term means 'Fortran-like', just like 'Pascalian' which means 'Pascal-like'. Most of the OO beginners program in that way: mechanical, arrays, nested loops and very much a spaghetti control flow. e.g. building a character array that contains just the characters 'A', 'B', 'C' etc. is simply Fortranesque because you couldn't do it another/better way in that language.
kind regards,
Jos
ps. I used to program in Fortran IV and Fortran 77 and Pascal too, but I got over it ;-)
Similar Threads
-
What are you using to write your code?
By CaptainMorgan in forum New To JavaReplies: 948Last Post: Yesterday, 12:41 PM -
How To Write Unmaintainable Code
By tim in forum Forum LobbyReplies: 2Last Post: 02-07-2010, 09:19 PM -
Can I write code in 2 different files ?
By fartek in forum New To JavaReplies: 2Last Post: 02-14-2009, 03:48 PM -
Help me to write a secure code
By Bhavis in forum Advanced JavaReplies: 4Last Post: 01-21-2009, 06:06 AM -
How to write code comments
By Java Tip in forum java.langReplies: 0Last Post: 04-23-2008, 08:06 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks