Portia is a genus of web-invading araneophagic jumping spiders known from earlier studies to derive aggressive-mimicry signals by using a generate-and-test algorithm (trial-and-error tactic). Here P. fimbriata's use of trial-and-error to solve a confinement problem (how to escape from an island surrounded by water) is investigated. Spiders choose between two potential escape tactics (leap or swim), one of which will fail (bring spider no closer to edge of tray) and the other of which will partially succeed (bring spider closer to edge of tray). The particular choice that will partially succeed is unknown to the spider. Using trial-anderror, P.fimbriata solves the confinement problem both when correct choices are rewarded (i.e. when the spider is moved closer to edge of tray) and when incorrect choices are punished (i.e. when the spider gets no closer to edge of tray).