I've got 2 simple text files:
besede.txt
To je vsebina datoteke z besedami. V njej so razlicne besede ki imajo lahko pomen ali pa tudi ne.
skrivno.txt
4 3 19 2 3 2 4 3
I wrote a program which receives these 2 files' names as arguments. It finds pairs of numbers in skrivno.txt
and the first number in the pair is the index of the word in besede.txt
; the second number in the pair is the index of the letter in that word.
So in this case I get:
- 4th word, 3rd letter - T
- 19th word, 2nd letter - E
- 3rd word, 2nd letter - S
- 4th word, 3rd letter - T
So, TEST.
Here is my program that does this. I'm open to suggestions on what I could improve and do better, etc.
public class meow {
public static void main(String args[]) throws Exception{
Scanner sc1 = new Scanner(new File(args[0])); //besede.txt
Scanner sc2 = new Scanner(new File(args[1])); //skrivno.txt
int inW = 0, inL = 0; //index of word, index of line
String text = "", code = "";
while(sc1.hasNext()){
text += sc1.next() + " ";
}
String[] text2 = text.split(" ");
while(sc2.hasNext()){
inW = sc2.nextInt();
inL = sc2.nextInt();
if(inW == 0 && inL == 0){
code += " ";
}
code += text2[inW-1].charAt(inL-1);
}
System.out.printf("%s\n", code);
}
}
I've got 2 simple text files:
besede.txt
To je vsebina datoteke z besedami. V njej so razlicne besede ki imajo lahko pomen ali pa tudi ne.
skrivno.txt
4 3 19 2 3 2 4 3
I wrote a program which receives these 2 files' names as arguments. It finds pairs of numbers in skrivno.txt
and the first number in the pair is the index of the word in besede.txt
; the second number in the pair is the index of the letter in that word.
So in this case I get:
- 4th word, 3rd letter - T
- 19th word, 2nd letter - E
- 3rd word, 2nd letter - S
- 4th word, 3rd letter - T
So, TEST.
Here is my program that does this. I'm open to suggestions on what I could improve and do better, etc.
public class meow {
public static void main(String args[]) throws Exception{
Scanner sc1 = new Scanner(new File(args[0])); //besede.txt
Scanner sc2 = new Scanner(new File(args[1])); //skrivno.txt
int inW = 0, inL = 0; //index of word, index of line
String text = "", code = "";
while(sc1.hasNext()){
text += sc1.next() + " ";
}
String[] text2 = text.split(" ");
while(sc2.hasNext()){
inW = sc2.nextInt();
inL = sc2.nextInt();
if(inW == 0 && inL == 0){
code += " ";
}
code += text2[inW-1].charAt(inL-1);
}
System.out.printf("%s\n", code);
}
}
I've got 2 simple text files:
besede.txt
To je vsebina datoteke z besedami. V njej so razlicne besede ki imajo lahko pomen ali pa tudi ne.
skrivno.txt
4 3 19 2 3 2 4 3
I wrote a program which receives these 2 files' names as arguments. It finds pairs of numbers in skrivno.txt
and the first number in the pair is the index of the word in besede.txt
; the second number in the pair is the index of the letter in that word.
So in this case I get:
- 4th word, 3rd letter - T
- 19th word, 2nd letter - E
- 3rd word, 2nd letter - S
- 4th word, 3rd letter - T
So, TEST.
Here is my program that does this. I'm open to suggestions on what I could improve and do better, etc.
public class meow {
public static void main(String args[]) throws Exception{
Scanner sc1 = new Scanner(new File(args[0])); //besede.txt
Scanner sc2 = new Scanner(new File(args[1])); //skrivno.txt
int inW = 0, inL = 0; //index of word, index of line
String text = "", code = "";
while(sc1.hasNext()){
text += sc1.next() + " ";
}
String[] text2 = text.split(" ");
while(sc2.hasNext()){
inW = sc2.nextInt();
inL = sc2.nextInt();
if(inW == 0 && inL == 0){
code += " ";
}
code += text2[inW-1].charAt(inL-1);
}
System.out.printf("%s\n", code);
}
}
I've got this 2 simple text files written in Notepad. The content of the first one, called besede.txt is:
To je vsebina datoteke z besedami. V njej so razlicne besede ki imajo lahko pomen ali pa tudi ne.besede.txt
The content of the second one, called skrivno.txt is:
To je vsebina datoteke z besedami. V njej so razlicne besede ki imajo lahko pomen ali pa tudi ne.
skrivno.txt
4 3 19 2 3 2 4 34 3 19 2 3 2 4 3
I wrote a program which receives thosethese 2 filesfiles' names as an argumentarguments. It checksIt finds pairs of numbers in skrivno.txtskrivno.txt
and the first number of 2in the pair is the numberindex of the word in besede.txt andbesede.txt
; the second number in numberthe pair is the index of the letter in that word.
So in this case I get:
- 4th word, 3rd letter - T
- 19th word, 2nd letter - E
- 3rd word, 2nd letter - S
- 4th word, 3rd letter - T
So, TEST.
Here is my program that does this. I'mI'm open to suggestions on what I could improve and do better, etc.
public class meow {
public static void main(String args[]) throws Exception{
Scanner sc1 = new Scanner(new File(args[0])); //besede.txt
Scanner sc2 = new Scanner(new File(args[1])); //skrivno.txt
int inW = 0, inL = 0; //index of word, index of line
String text = "", code = "";
while(sc1.hasNext()){
text += sc1.next() + " ";
}
String[] text2 = text.split(" ");
while(sc2.hasNext()){
inW = sc2.nextInt();
inL = sc2.nextInt();
if(inW == 0 && inL == 0){
code += " ";
}
code += text2[inW-1].charAt(inL-1);
}
System.out.printf("%s\n", code);
}
}
I've got this 2 simple files written in Notepad. The content of the first one, called besede.txt is:
To je vsebina datoteke z besedami. V njej so razlicne besede ki imajo lahko pomen ali pa tudi ne.
The content of the second one, called skrivno.txt is:
4 3 19 2 3 2 4 3
I wrote a program which receives those 2 files as an argument. It checks pairs of numbers in skrivno.txt and the first number of 2 is the number of word in besede.txt and second number in number of the letter in that word.
So in this case I get:
- 4th word, 3rd letter - T
- 19th word, 2nd letter - E
- 3rd word, 2nd letter - S
- 4th word, 3rd letter - T
So, TEST.
Here is my program that does this. I'm open to suggestions on what I could improve and do better, etc.
public class meow {
public static void main(String args[]) throws Exception{
Scanner sc1 = new Scanner(new File(args[0])); //besede.txt
Scanner sc2 = new Scanner(new File(args[1])); //skrivno.txt
int inW = 0, inL = 0; //index of word, index of line
String text = "", code = "";
while(sc1.hasNext()){
text += sc1.next() + " ";
}
String[] text2 = text.split(" ");
while(sc2.hasNext()){
inW = sc2.nextInt();
inL = sc2.nextInt();
if(inW == 0 && inL == 0){
code += " ";
}
code += text2[inW-1].charAt(inL-1);
}
System.out.printf("%s\n", code);
}
}
I've got 2 simple text files:
besede.txt
To je vsebina datoteke z besedami. V njej so razlicne besede ki imajo lahko pomen ali pa tudi ne.
skrivno.txt
4 3 19 2 3 2 4 3
I wrote a program which receives these 2 files' names as arguments. It finds pairs of numbers in skrivno.txt
and the first number in the pair is the index of the word in besede.txt
; the second number in the pair is the index of the letter in that word.
So in this case I get:
- 4th word, 3rd letter - T
- 19th word, 2nd letter - E
- 3rd word, 2nd letter - S
- 4th word, 3rd letter - T
So, TEST.
Here is my program that does this. I'm open to suggestions on what I could improve and do better, etc.
public class meow {
public static void main(String args[]) throws Exception{
Scanner sc1 = new Scanner(new File(args[0])); //besede.txt
Scanner sc2 = new Scanner(new File(args[1])); //skrivno.txt
int inW = 0, inL = 0; //index of word, index of line
String text = "", code = "";
while(sc1.hasNext()){
text += sc1.next() + " ";
}
String[] text2 = text.split(" ");
while(sc2.hasNext()){
inW = sc2.nextInt();
inL = sc2.nextInt();
if(inW == 0 && inL == 0){
code += " ";
}
code += text2[inW-1].charAt(inL-1);
}
System.out.printf("%s\n", code);
}
}
Reading text from 2 files. Java
So I've got this 2 simple files writenwritten in notpadNotepad.
The The content of the first one, called besede.txt is: To je vsebina datoteke z besedami. V njej so razlicne besede ki imajo lahko pomen ali pa tudi ne.
To je vsebina datoteke z besedami. V njej so razlicne besede ki imajo lahko pomen ali pa tudi ne.
The content of the second one, called skrivno.txt is: 4 3 19 2 3 2 4 3
4 3 19 2 3 2 4 3
I wrote a program (in Java) which recievesreceives those 2 files as an argument.
And what it does is baisically this: It It checks pairs of numbers in skrivno.txt and the first number of 2 is the number of word in besede.txt and second number in number of the letter in that word.
So in this case iI get:
4th word, 3rd letter - T
19th word, 2nd letter - E
3rd word, 2nd letter - S
4th word, 3rd letter - T
- 4th word, 3rd letter - T
- 19th word, 2nd letter - E
- 3rd word, 2nd letter - S
- 4th word, 3rd letter - T
So, TEST.
Here is my program that does this. And I'm opened I'm open to suggestions, on what I could improve, so and do better, etc.
Help would be much appreciated.
<br
public class meow {
public static void main(String args[]) throws Exception{
Scanner sc1 = new Scanner(new File(args[0])); //besede.txt
Scanner sc2 = new Scanner(new File(args[1])); //skrivno.txt
int inW = 0, inL = 0; //index of word, index of line
String text = "", code = "";
while(sc1.hasNext()){
text += sc1.next() + " ";
}
String[] text2 = text.split(" ");
while(sc2.hasNext()){
inW = sc2.nextInt();
inL = sc2.nextInt();
if(inW == 0 && inL == 0){
code += " ";
}
code += text2[inW-1].charAt(inL-1);
}
System.out.printf("%s\n", code);
}
}
Reading text from 2 files. Java
So I've got this 2 simple files writen in notpad.
The content of the first one, called besede.txt is: To je vsebina datoteke z besedami. V njej so razlicne besede ki imajo lahko pomen ali pa tudi ne.
The content of the second one, called skrivno.txt is: 4 3 19 2 3 2 4 3
I wrote a program (in Java) which recieves those 2 files as an argument.
And what it does is baisically this: It checks pairs of numbers in skrivno.txt and the first number of 2 is the number of word in besede.txt and second number in number of the letter in that word.
So in this case i get:
4th word, 3rd letter - T
19th word, 2nd letter - E
3rd word, 2nd letter - S
4th word, 3rd letter - T
So, TEST.
Here is my program that does this. And I'm opened to suggestions, what I could improve, so better etc.
Help would be much appreciated.
<br
public class meow {
public static void main(String args[]) throws Exception{
Scanner sc1 = new Scanner(new File(args[0])); //besede.txt
Scanner sc2 = new Scanner(new File(args[1])); //skrivno.txt
int inW = 0, inL = 0; //index of word, index of line
String text = "", code = "";
while(sc1.hasNext()){
text += sc1.next() + " ";
}
String[] text2 = text.split(" ");
while(sc2.hasNext()){
inW = sc2.nextInt();
inL = sc2.nextInt();
if(inW == 0 && inL == 0){
code += " ";
}
code += text2[inW-1].charAt(inL-1);
}
System.out.printf("%s\n", code);
}
}
Reading text from 2 files
I've got this 2 simple files written in Notepad. The content of the first one, called besede.txt is:
To je vsebina datoteke z besedami. V njej so razlicne besede ki imajo lahko pomen ali pa tudi ne.
The content of the second one, called skrivno.txt is:
4 3 19 2 3 2 4 3
I wrote a program which receives those 2 files as an argument. It checks pairs of numbers in skrivno.txt and the first number of 2 is the number of word in besede.txt and second number in number of the letter in that word.
So in this case I get:
- 4th word, 3rd letter - T
- 19th word, 2nd letter - E
- 3rd word, 2nd letter - S
- 4th word, 3rd letter - T
So, TEST.
Here is my program that does this. I'm open to suggestions on what I could improve and do better, etc.
public class meow {
public static void main(String args[]) throws Exception{
Scanner sc1 = new Scanner(new File(args[0])); //besede.txt
Scanner sc2 = new Scanner(new File(args[1])); //skrivno.txt
int inW = 0, inL = 0; //index of word, index of line
String text = "", code = "";
while(sc1.hasNext()){
text += sc1.next() + " ";
}
String[] text2 = text.split(" ");
while(sc2.hasNext()){
inW = sc2.nextInt();
inL = sc2.nextInt();
if(inW == 0 && inL == 0){
code += " ";
}
code += text2[inW-1].charAt(inL-1);
}
System.out.printf("%s\n", code);
}
}