Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: How to solve pancake flip with Python
Post: RE: How to solve pancake flip with Python
(May-09-2022, 04:16 PM)deanhystad Wrote: It is tough finding what you did wrong when the only information provided is code that produces the wrong result. Do you have a description of what "heurist... |
|
longmen |
Homework |
5 |
2,165 |
May-09-2022, 04:25 PM |
|
|
Thread: How to solve pancake flip with Python
Post: RE: How to solve pancake flip with Python
(May-09-2022, 03:56 PM)deanhystad Wrote: You have an error computing the heuristic value.Yes, I am aware. I am doing this instead but it is not the solution.
if self.pancake_stack[3][1] == 'b' or ... |
|
longmen |
Homework |
5 |
2,165 |
May-09-2022, 04:15 PM |
|
|
Thread: How to solve pancake flip with Python
Post: How to solve pancake flip with Python
Hi I wonder if anyone could help me with this issue. So I am doing the pancake flip and I am trying to get the end result as
1b2w3b4b| g:0, h:0
4w|3w2b1w g:4, h:4
4b3w|2b1w g:5, h:4
3b|4w2b1w g:7, h... |
|
longmen |
Homework |
5 |
2,165 |
May-09-2022, 03:23 PM |
|
|
Thread: How to remove extra space from output list?
Post: RE: How to remove extra space from output list?
Thank you. That answers my question.
(May-05-2022, 10:21 AM)ibreeden Wrote: Deanhystad is right, it is not a very robust way of processing input. But if you can be sure the first letter is followed... |
|
longmen |
Homework |
3 |
1,856 |
May-05-2022, 11:04 PM |
|
|
Thread: How to remove extra space from output list?
Post: How to remove extra space from output list?
Hi,
I have this input P (0, 2,+1) (2, 0, -1) (0, 4,+1) (4, 0, -1) and I would like to have it printed out this way [(0, 2, 1), (2, 0, -1), (0, 4, 1), (4, 0, -1)]. However, due to the extra space in ... |
|
longmen |
Homework |
3 |
1,856 |
May-05-2022, 03:12 AM |
|
|
Thread: How to fix list index out of range
Post: RE: How to fix list index out of range
(Apr-25-2022, 08:33 PM)deanhystad Wrote: There are lots of articles online. This one is solving a problem identical to yours.
https://www.learndatasci.com/tutorials/r...penai-gym/
I still cannot f... |
|
longmen |
Homework |
26 |
6,241 |
Apr-27-2022, 05:39 PM |
|
|
Thread: How to fix list index out of range
Post: RE: How to fix list index out of range
(Apr-25-2022, 01:54 AM)deanhystad Wrote: I am stepping up from pretty sure to I know it is wrong. When you make a node the numbers in the list are the node numbers for the neighbors of the node. F... |
|
longmen |
Homework |
26 |
6,241 |
Apr-25-2022, 05:44 PM |
|
|
Thread: How to fix list index out of range
Post: RE: How to fix list index out of range
(Apr-25-2022, 01:54 AM)deanhystad Wrote: I am stepping up from pretty sure to I know it is wrong. When you make a node the numbers in the list are the node numbers for the neighbors of the node. F... |
|
longmen |
Homework |
26 |
6,241 |
Apr-25-2022, 02:22 AM |
|
|
Thread: How to fix list index out of range
Post: RE: How to fix list index out of range
(Apr-24-2022, 11:14 PM)deanhystad Wrote: I'm pretty sure that is wrong. Going down from node 2 or node 3 should not take you to node 1.
No it is not but it is the closest to the solution I am looki... |
|
longmen |
Homework |
26 |
6,241 |
Apr-25-2022, 12:20 AM |
|
|
Thread: How to fix list index out of range
Post: RE: How to fix list index out of range
(Apr-24-2022, 07:14 PM)deanhystad Wrote: Is this correct?
Node_Start = Node(S, [6, 3, 1, 1])
Node_3 = Node(3, [7, 4, 1, S])It think your board is still riddled with errors. You woul... |
|
longmen |
Homework |
26 |
6,241 |
Apr-24-2022, 10:45 PM |
|
|
Thread: How to fix list index out of range
Post: RE: How to fix list index out of range
(Apr-24-2022, 03:58 PM)deanhystad Wrote: You have not posted any code that can produce that output. I cannot explain why code I have not seen does not work as expected.
I figured out that also. How... |
|
longmen |
Homework |
26 |
6,241 |
Apr-24-2022, 05:22 PM |
|
|
Thread: How to fix list index out of range
Post: RE: How to fix list index out of range
(Apr-24-2022, 03:31 PM)deanhystad Wrote: If 16 is supposed to be up that means your board is wrong and 16 up cannot be a wall.
Though your solution is inefficient I think it works. Any problems yo... |
|
longmen |
Homework |
26 |
6,241 |
Apr-24-2022, 03:42 PM |
|
|
Thread: How to fix list index out of range
Post: RE: How to fix list index out of range
(Apr-24-2022, 02:59 AM)deanhystad Wrote: As far as this:
Quote:Can you elaborate on insert() to set move or values?
What do you think list.insert(value) does? It is not the correct way to SET valu... |
|
longmen |
Homework |
26 |
6,241 |
Apr-24-2022, 02:51 PM |
|
|
Thread: How to fix list index out of range
Post: RE: How to fix list index out of range
(Apr-23-2022, 10:32 PM)deanhystad Wrote: I still think your building the board incorrectly. You should not be using insert() to set moves or values.
You should describe how your Q_learning functio... |
|
longmen |
Homework |
26 |
6,241 |
Apr-24-2022, 02:25 AM |
|
|
Thread: How to fix list index out of range
Post: RE: How to fix list index out of range
It has been three days and I could not make much progress. This is how close I am getting to the expected result. However, it still does not print out the out put that I want.
For example with this
wi... |
|
longmen |
Homework |
26 |
6,241 |
Apr-23-2022, 07:02 PM |
|
|
Thread: How to fix list index out of range
Post: RE: How to fix list index out of range
@deanhystad Thanks for your responses. It has been very helpful.
I am testing this input 12 7 5 6 p with the code and it prints this output:
1Action.RIGHT
2Action.RIGHT
3Action.UP
4Action.LEFT
5EXIT
6... |
|
longmen |
Homework |
26 |
6,241 |
Apr-20-2022, 01:54 AM |
|
|
Thread: How to fix list index out of range
Post: RE: How to fix list index out of range
I wonder if you could explain and simplify this line of code
self.tiles = [[1]*4 for n in range(4)]as well as this one? Thanks
action = random.choice([x for x in cur_tile.actions if x is not None]) |
|
longmen |
Homework |
26 |
6,241 |
Apr-18-2022, 03:12 PM |
|
|
Thread: How to fix list index out of range
Post: RE: How to fix list index out of range
Hi , Thanks for your response. Here is the input that I am supposed to the feed to the program 14 12 7 6 p. However, I seem to not be able to figure out where to feed the input into this code. Also, I... |
|
longmen |
Homework |
26 |
6,241 |
Apr-15-2022, 03:54 AM |
|
|
Thread: How to fix list index out of range
Post: How to fix list index out of range
Hi everyone, so when I ran the below code I ran into this problem and I wonder if anyone has advice on how to fix it? Any advice would be very appreciated.Thanks
Traceback (most recent call last):
... |
|
longmen |
Homework |
26 |
6,241 |
Apr-13-2022, 02:28 AM |
|
|
Thread: How to print out the children index of the search tree?
Post: RE: How to print out the children index of the sea...
(Apr-01-2022, 11:00 PM)deanhystad Wrote: I cannot duplicate your results. I thought it was because I called the pruning function incorrectly, but now I think it is because I am starting with a diff... |
|
longmen |
Homework |
7 |
2,232 |
Apr-02-2022, 12:09 AM |