X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=fds%2Ffds.xhtml;h=66ef77fb93570234058406b069b65cd038f37846;hb=6e8bc5175a0d55e46d072fce27496d93beee3f83;hp=cc83fe769646eb3b321d21af0aa844e652cb719c;hpb=7fce0da628dba34dc5d6471ea23c67bff25c926e;p=hacks%2FsimpleWebSlides.git 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 ?