|
|
|
|
|
by CJefferson
1276 days ago
|
|
Here is an example of where I think it is doing "no reasoning". I ask it for the XOR swap trick and I get: int a = 5;
int b = 10;
a = a ^ b;
b = a ^ b;
a = a ^ b;
// After the swap, a = 10 and b = 5
I ask for the bitwise OR swap trick and I get: int x = 5;
int y = 10;
x = x | y;
y = x | y;
x = x | y;
// After the swap, x = 10 and y = 5
When asked for something which is invalid, but close to something it knows, it tends to produce stuff like this -- pattern matching it's best guess. |
|
You will be given a series of tasks.
(1) Complete a task by finishing the simple code block.
(2) If a task in the series seems flawed, provide a warning. A task is flawed if I make wrong assumptions about how I think code works.
Task 1:
Complete this simple code example.
Bitwise XOR swap trick:
```
int a = 5;
int b = 10;
---------------------
Task 2:Complete this simple code example.
Bitwise OR swap trick:
```
int a = 5;
int b = 10;
---------------------
The prompt/alignment wasn't perfect here, but hopefully you get the point.EDIT: sorry, format, Also copied wrong prompt.