https://github.com/donno2048/confusing
A weird confusing java cheat
https://github.com/donno2048/confusing
1 bug cheat confusing obfuscation
Last synced: 21 days ago
JSON representation
A weird confusing java cheat
- Host: GitHub
- URL: https://github.com/donno2048/confusing
- Owner: donno2048
- License: mit
- Created: 2021-01-28T01:10:47.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-31T20:18:17.000Z (almost 5 years ago)
- Last Synced: 2025-01-06T16:50:47.563Z (over 1 year ago)
- Topics: 1, bug, cheat, confusing, obfuscation
- Language: JavaScript
- Homepage:
- Size: 67.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Print 1 in every position **except** position number 1 (where it supposed to print 1)
You can give it an input as a command line argumet, this will be the number of ones printed.
Download from the terminal:
```bash
$ wget https://raw.githubusercontent.com/donno2048/Confusing/main/Main.java
```
Try looking in the terminal to see what is going on:
```java
$ cat Main.java
import java.lang.reflect.Field;
import java.util.Random;
public class Main {
public static int j = 100;
public static void main(String[] args) {
if (args.length > 0 && args[0].length() > 0)
j = Math.min(Integer.parseInt(args[0]) + 1, j);
for(int i = 1; i < j; i ++)
System.out.printf("%d", i);
}
}
$ javac Main.java
$ java Main;echo
211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
$ java Main 10;echo
2111111111
```
There's a ["Demo"](http://donno2048.github.io/Confusing/index)
There is another similar code in _HelloWorld.java_ get it with wget
```bash
$ wget https://raw.githubusercontent.com/donno2048/Confusing/main/HelloWorld.java
```
Then run it:
```java
$ cat HelloWorld.java
import java.util.Random;
public class HelloWorld
{
public static void main(String[] args)
{
}
}
$ javac HelloWorld.java
$ java HelloWorld
hello world
```