/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
// your code goes here
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKCX0KfQ==
CgpgYGAKaW1wb3J0IGphdmF4LnN3aW5nLio7CmltcG9ydCBqYXZhLmF3dC4qOwppbXBvcnQgamF2YS5hd3QuZXZlbnQuKjsKCnB1YmxpYyBjbGFzcyBQYXJrb3VyR2FtZSBleHRlbmRzIEpQYW5lbCB7CgogICAgcHJpdmF0ZSBpbnQgcGxheWVyWCA9IDEwMDsKICAgIHByaXZhdGUgaW50IHBsYXllclkgPSAxMDA7CiAgICBwcml2YXRlIGludCBwbGF5ZXJTcGVlZCA9IDU7CgogICAgcHVibGljIFBhcmtvdXJHYW1lKCkgewogICAgICAgIHNldEJhY2tncm91bmQoQ29sb3IuQkxBQ0spOwogICAgICAgIHNldFByZWZlcnJlZFNpemUobmV3IERpbWVuc2lvbig4MDAsIDYwMCkpOwogICAgICAgIGFkZEtleUxpc3RlbmVyKG5ldyBLZXlMaXN0ZW5lcigpIHsKICAgICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgICAgIHB1YmxpYyB2b2lkIGtleVR5cGVkKEtleUV2ZW50IGUpIHt9CgogICAgICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgICAgcHVibGljIHZvaWQga2V5UHJlc3NlZChLZXlFdmVudCBlKSB7CiAgICAgICAgICAgICAgICBpZiAoZS5nZXRLZXlDb2RlKCkgPT0gS2V5RXZlbnQuVktfTEVGVCkgewogICAgICAgICAgICAgICAgICAgIHBsYXllclggLT0gcGxheWVyU3BlZWQ7CiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGUuZ2V0S2V5Q29kZSgpID09IEtleUV2ZW50LlZLX1JJR0hUKSB7CiAgICAgICAgICAgICAgICAgICAgcGxheWVyWCArPSBwbGF5ZXJTcGVlZDsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZS5nZXRLZXlDb2RlKCkgPT0gS2V5RXZlbnQuVktfVVApIHsKICAgICAgICAgICAgICAgICAgICBwbGF5ZXJZIC09IHBsYXllclNwZWVkOwogICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlLmdldEtleUNvZGUoKSA9PSBLZXlFdmVudC5WS19ET1dOKSB7CiAgICAgICAgICAgICAgICAgICAgcGxheWVyWSArPSBwbGF5ZXJTcGVlZDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHJlcGFpbnQoKTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgICAgIHB1YmxpYyB2b2lkIGtleVJlbGVhc2VkKEtleUV2ZW50IGUpIHt9CiAgICAgICAgfSk7CiAgICAgICAgc2V0Rm9jdXNhYmxlKHRydWUpOwogICAgfQoKICAgIEBPdmVycmlkZQogICAgcHJvdGVjdGVkIHZvaWQgcGFpbnRDb21wb25lbnQoR3JhcGhpY3MgZykgewogICAgICAgIHN1cGVyLnBhaW50Q29tcG9uZW50KGcpOwogICAgICAgIGcuc2V0Q29sb3IoQ29sb3IuV0hJVEUpOwogICAgICAgIGcuZmlsbFJlY3QocGxheWVyWCwgcGxheWVyWSwgNTAsIDUwKTsKICAgIH0KCiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgSkZyYW1lIGZyYW1lID0gbmV3IEpGcmFtZSgmcXVvdDtQYXJrb3VyIEdhbWUmcXVvdDspOwogICAgICAgIGZyYW1lLnNldERlZmF1bHRDbG9zZU9wZXJhdGlvbihKRnJhbWUuRVhJVF9PTl9DTE9TRSk7CiAgICAgICAgZnJhbWUuYWRkKG5ldyBQYXJrb3VyR2FtZSgpKTsKICAgICAgICBmcmFtZS5wYWNrKCk7CiAgICAgICAgZnJhbWUuc2V0TG9jYXRpb25SZWxhdGl2ZVRvKG51bGwpOwogICAgICAgIGZyYW1lLnNldFZpc2libGUodHJ1ZSk7CiAgICB9Cn0KYGBgCgo=
```
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ParkourGame extends JPanel {
private int playerX = 100;
private int playerY = 100;
private int playerSpeed = 5;
public ParkourGame() {
setBackground(Color.BLACK);
setPreferredSize(new Dimension(800, 600));
addKeyListener(new KeyListener() {
@Override
public void keyTyped(KeyEvent e) {}
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_LEFT) {
playerX -= playerSpeed;
} else if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
playerX += playerSpeed;
} else if (e.getKeyCode() == KeyEvent.VK_UP) {
playerY -= playerSpeed;
} else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
playerY += playerSpeed;
}
repaint();
}
@Override
public void keyReleased(KeyEvent e) {}
});
setFocusable(true);
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.WHITE);
g.fillRect(playerX, playerY, 50, 50);
}
public static void main(String[] args) {
JFrame frame = new JFrame("Parkour Game");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(new ParkourGame());
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
}
```