From: Kim Nguyễn Date: Tue, 14 Oct 2014 10:54:51 +0000 (+0200) Subject: Merge branch 'master' of ssh://git.nguyen.vg/hacks/simpleWebSlides X-Git-Url: http://git.nguyen.vg/gitweb/?a=commitdiff_plain;h=69b360cc5d48766c89395e89c7081a2736f1d5f6;hp=7fce0da628dba34dc5d6471ea23c67bff25c926e;p=hacks%2FsimpleWebSlides.git Merge branch 'master' of ssh://git.nguyen.vg/hacks/simpleWebSlides Conflicts: fds/fds.xhtml --- diff --git a/fds/fds.xhtml b/fds/fds.xhtml index cc83fe7..66ef77f 100644 --- a/fds/fds.xhtml +++ b/fds/fds.xhtml @@ -31,8 +31,42 @@ //Ensures that we load SWS at the very end, after MathJax has //been initialized + var toggle_circuit = function (id) { + var v = $("#" + id).text(); + var nv = "0"; + if (v == "0") { nv = "1"; }; + $("#" + id).text(nv); + draw_circuit(); + }; + + var draw_circuit = function() { + var i0 = parseInt($("#input0").text()); + var i1 = parseInt($("#input1").text()); + var r = (i0 + i1) % 2; + var c = (Math.floor((i0 + i1) / 2)) %2; + $("#result").text(r) + $("#carry").text(c) + $(".num").each(function (i, e) { + var txt = parseInt($(e).text()); + if (txt == 0) { + $(e).css( 'background', '#aaaaff'); + } else { + $(e).css( 'background', '#aaffaa'); + } + }); + + }; + + + $(window).load(SWS.Presentation.init); + @@ -47,9 +81,8 @@

Comment fonctionne un ordinateur ?

-
- +
@@ -57,7 +90,7 @@

Comment fonctionne un ordinateur ?

@@ -131,13 +164,52 @@ passe (1) ou ne passe pas (0)

-

Compter avec des 0 et des 1 ?

+

Représenter tous les nombres des 0 et des 1 ?