Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution of Polygone 360 is broken #130

Open
PLMbugz opened this issue Sep 13, 2016 · 2 comments
Open

Solution of Polygone 360 is broken #130

PLMbugz opened this issue Sep 13, 2016 · 2 comments

Comments

@PLMbugz
Copy link

PLMbugz commented Sep 13, 2016

Voici mon code :

def polygone(n:Int,x:Int) {
  for (i <- 1 to n) {
    avance(x);droite(360/n)
  }
}

override def run() {
  polygone(360,2)
}

Une erreur est renvoyée sur la position pour une cause inconnue.

Lesson: turtleart
Exercise: turtleart.polygon360.Polygon360
Programming Language: Scala
Lang: fr
PLM version: 2.6-pre (20150202)
webPLM version: 2.0.3
Public user ID: PLM51ec212414ae7a86a5ef9ab8171712951df5752e

@mquinson
Copy link
Member

Indeed, this exercise is not passed by the infrastructure. I take the expected correction, and I get the same error than this student.

Le monde 'Polygon360' diffère: x1 diffère. (trouvé Line (x263.445 y135.028 / x264.177 y149.000 / black) au lieu de Line (x263.968 y154.996 / x264.177 y149.000 / black) ) 

@MatthieuNICOLAS could you please check if everything is correctly generated? It also leads to questions about the testing infrastructure, that seem to not correctly test everything. I'm personally quite puzzled.

@mquinson mquinson changed the title Erreur Polygone 360 Solution of Polygone 360 is broken Sep 18, 2016
@MatthieuNICOLAS
Copy link
Member

It seems that the computation of the objective state of this exercise goes wrongly since a part of the polygon is missing:
missing_line
I also highlighted the lines that the application is trying to compare with the following code:

var c = document.getElementById('canvas')
var ctx = c.getContext('2d')

ctx.beginPath()
ctx.strokeStyle = 'blue'
ctx.lineWidth=5
ctx.moveTo(263.445, 135.028)
ctx.lineTo(264.177, 149.000)
ctx.stroke()

ctx.beginPath()
ctx.strokeStyle = 'red'
ctx.lineWidth=5
ctx.moveTo(263.968, 154.996)
ctx.lineTo(264.177, 149.000)
ctx.stroke()

Here is the result:
show_lines
The blue line seems to be missing in the objective world while the red one seems to be missing in the current one according to the dumps of theirs models:

// Lines of the current world with x1 or x2 > 262
CurrentWorld: Line (x262,263 y127,117 / x263,445 y135,028 / black) 
CurrentWorld: Line (x262,923 y164,938 / x263,968 y154,996 / black) 
CurrentWorld: Line (x263,445 y135,028 / x264,177 y149,000 / black)

// Lines of the answer world with x1 or x2 > 262
AnswerWorld: Line (x262,263 y127,117 / x263,445 y135,028 / black) 
AnswerWorld: Line (x262,923 y164,938 / x263,968 y154,996 / black) 
AnswerWorld: Line (x263,968 y154,996 / x264,177 y149,000 / black) 

What puzzles me now is why running twice the same code (the expected correction) produces two different results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants