... | ... | @@ -89,23 +89,23 @@ Examples of labels: |
|
|
## Code
|
|
|
|
|
|
Example of a function:
|
|
|
`coom`
|
|
|
class GenerateRandom {
|
|
|
|
|
|
public int generateRandom(int param1, int param2) {
|
|
|
int min = param1;
|
|
|
int max = param2;
|
|
|
`class GenerateRandom {`
|
|
|
|
|
|
int random_int = (int)Math.floor(Math.random() * (max - min + 1) + min);
|
|
|
`public int generateRandom(int param1, int param2) {`
|
|
|
`int min = param1;`
|
|
|
`int max = param2;`
|
|
|
|
|
|
`int random_int = (int)Math.floor(Math.random() * (max - min + 1) + min);`
|
|
|
|
|
|
return random_int;
|
|
|
}
|
|
|
`return random_int;`
|
|
|
`}`
|
|
|
|
|
|
public static void main( String args[] ) {
|
|
|
System.out.println(generateRandom(10, 40));
|
|
|
}
|
|
|
`public static void main( String args[] ) {`
|
|
|
`System.out.println(generateRandom(10, 40));`
|
|
|
`}`
|
|
|
|
|
|
}
|
|
|
`}`
|
|
|
|
|
|
- Tabwidth is 2 spaces.
|
|
|
- Newline before return sequence, unless it is a oneliner.
|
... | ... | |