BridgesUNCC / bridges-java

JAVA Client library for Bridges
http://bridgesuncc.github.io
GNU General Public License v2.0
4 stars 12 forks source link

Linked list Issue (URGENT). #95

Closed krs-world closed 6 years ago

krs-world commented 7 years ago

Lucas, it looks like there is a major bug in your doubly linked list rendering. As per the earlier emails from the user, I checked my client code to see how the JSON was being generated. Here is an example JSON I just generated, where I didnt set the previous poointers at all but your visualization still automatically generates the links like a normal linked list.

(From what I can tell, I am generating the JSON right (the example below was built intentionally to ignore the prev. links in the doubly linked list)

You should not make any assumptions on the links, only dray the links that are specified and between the nodes that are specified. So in this case, the user explicitly drew the links between two arbitrary nodes, but the visualization was ignoring that. We NEVER want to do that. Whatever the JSON says, we respect that. Else, students wont be able to find errors they make in assigning links.

Here is the JSON from the example:

kalpathi-world% java sllist4 {"name": "edu.uncc.cs.bridges","version": "0.4.0","visual": "DoublyLinkedList","title": "","description": "","nodes": [{"name":"dummy","shape":"circle","size":10.0,"color":[255,0,0,1.0],"location":[0.0,0.0]},{"name":"alice","shape":"circle","size":10.0,"color":[70,130,180,1.0],"location":[0.0,0.0]},{"name":"bob","shape":"circle","size":10.0,"color":[70,130,180,1.0],"location":[0.0,0.0]},{"name":"chad","shape":"circle","size":10.0,"color":[70,130,180,1.0],"location":[0.0,0.0]},{"name":"dan","shape":"circle","size":10.0,"color":[70,130,180,1.0],"location":[0.0,0.0]}],"links": [{"color":[70,130,180,1.0],"thickness":1.0,"name":1.0,"source":0,"target":1},{"color":[70,130,180,1.0],"thickness":1.0,"name":1.0,"source":1,"target":2},{"color":[70,130,180,1.0],"thickness":1.0,"name":1.0,"source":2,"target":3},{"color":[70,130,180,1.0],"thickness":1.0,"name":1.0,"source":3,"target":4}]} Check out your visuals at http://bridges-cs.herokuapp.com/assignments/0/kalpathi60?apikey=486749122386 kalpathi-world%

So fix the problem and tehn I will do some testing to ensure things are good. This is URGENT, lets fix it rightaway.

  -- krs