Marc
Nombre de messages : 2466 Age : 63 Localisation : TOURS (37) Date d'inscription : 17/03/2014
| Sujet: Enigme mathématique Lun 16 Avr 2018 - 2:26 | |
| Bonjour à tous ! 4=5 Je vous laisse découvrir cette énigme mathématique démontrée "Panoramiquement". - Code:
-
' ------------------------------------------------------------------------------ ' PANORAMIC Math Riddle ' Marc - April 2018 - Panoramic v0.9.28i17 ' http://panoramic-language.pagesperso-orange.fr/French/index.html ' http://panoramic.top-forum.net ' ------------------------------------------------------------------------------ Init() Animation() END ' ------------------------------------------------------------------------------ SUB Animation() DIM_LOCAL i%,x,y,mx,my DEGREES FOR i% = -200 to 140 STEP 4 SPRITE_POSITION 8,i%,20 SPRITE_POSITION 9,2*i%+65,20 PAUSE 30 NEXT i% SPRITE_POSITION 15,140,48 SPRITE_SHOW 15 PAUSE 1000 FOR i% = -200 to 155 SPRITE_POSITION 10,i%,110 SPRITE_POSITION 4, i%-60,92 NEXT i% PAUSE 500 FOR i% = 180 TO 0 STEP -5 x=110*COS(i%) y=110*SIN(i%) SPRITE_POSITION 4, x+205,y+92 PAUSE 30 IF i% < 20 SPRITE_POSITION 3,x+205,y+92 SPRITE_HIDE 4 END_IF NEXT i% PAUSE 500 SPRITE_POSITION 4,x+205,y+92 SPRITE_SHOW 4 SPRITE_HIDE 3 PAUSE 500 FOR i% = x+205 TO 650 SPRITE_X_POSITION 4, i% NEXT i% FOR i% = 650 TO x+205 STEP -1 SPRITE_X_POSITION 4,i%+115 SPRITE_POSITION 11,i%,110 NEXT i% SPRITE_POSITION 5,i%+115,y+92 PAUSE 500 SPRITE_SHOW 5 SPRITE_HIDE 4 PAUSE 500 FOR i% = i%+115 TO 650 STEP 5 SPRITE_X_POSITION 5,i% PAUSE 30 NEXT i% PAUSE 500 FOR i% = 500 TO 185 STEP -1 SPRITE_POSITION 12,27,i% NEXT i% PAUSE 1000 SPRITE_SHOW 4 FOR x = 0 TO 600 STEP 4 y=(50*SIN(x/390*360*2))+300 SPRITE_POSITION 4, x,y PAUSE 40 NEXT x PAUSE 1000 SPRITE_POSITION 13,91,260 PAUSE 2000 SPRITE_POSITION 6,158,258 SPRITE_POSITION 7,380,258 FOR i% = 1 to 3 SPRITE_SHOW 6 SPRITE_SHOW 7 PAUSE 350 SPRITE_HIDE 6 SPRITE_HIDE 7 PAUSE 350 NEXT i% SPRITE_SHOW 6 SPRITE_SHOW 7 PAUSE 750 SPRITE_POSITION 14,251,335 FOR i% = 1 to 5 SPRITE_HIDE i% SPRITE_POSITION i%,320,380 NEXT i% PAUSE 750 SPRITE_SHOW 3 PAUSE 1500 SPRITE_SHOW 4 SPRITE_HIDE 3 PAUSE 1000 SPRITE_HIDE 4 SPRITE_SHOW 1 PAUSE 500 SPRITE_SHOW 2 END_SUB ' ------------------------------------------------------------------------------ SUB SpritesText() SPRITE 8 SPRITE_TEXT 8,"Mathematical" SPRITE 9 SPRITE_TEXT 9,"Riddle" SPRITE 10 SPRITE_TEXT 10,"20 - 20 = " SPRITE 11 SPRITE_TEXT 11,"25 - 25" SPRITE 12 SPRITE_TEXT 12,"(4 x 5)-(4 x 5) = (5 x 5)-(5 x 5)" SPRITE 13 SPRITE_TEXT 13,"4 x (5 - 5) = 5 x (5 - 5)" SPRITE 14 SPRITE_TEXT 14,"4 = 5" SPRITE_POSITION 14,251,335 END_SUB ' ------------------------------------------------------------------------------ SUB Init() DIM_LOCAL i% LABEL Resize BORDER_SMALL 0 HEIGHT 0,500 WIDTH 0,600 ON_RESIZE 0,resize SCENE2D 100 FULL_SPACE 100 LEFT 0,(SCREEN_X-WIDTH(0))/2 TOP 0,(SCREEN_Y-HEIGHT(0))/2 CAPTION 0, "Marc - Math Riddle - April 2018" COLOR 100,100,100,255 FONT_NAME 100, "Courier New" FONT_COLOR 100,250,250,250 FONT_SIZE 100, 20 FONT_BOLD 100 SPRITE_CREATE_HIDE SpritesSmiley() SpritesText() SpritesGraph() SpriteWave() FOR i%=1 to 15 SPRITE_POSITION i%,0,-100 NEXT i% FOR i%=1 to 15 SPRITE_SHOW i% NEXT i% END_SUB ' ------------------------------------------------------------------------------ Resize: HEIGHT 0,500 WIDTH 0,600 RETURN ' ------------------------------------------------------------------------------ SUB SpritesGraph() DIM_LOCAL i% FOR i% = 6 to 7 PICTURE i% 2D_TARGET_IS i% WIDTH i%,105 HEIGHT i%,35 COLOR i%,0,0,0 2D_PEN_COLOR 240,240,0 2D_PEN_WIDTH 3 2D_LINE 0,35,105,0 IMAGE i%+50 2D_IMAGE_COPY i%+50,0,0,105,35 SPRITE i% SPRITE_IMAGE_LOAD i%,i%+50 NEXT i% SPRITE_POSITION 6,158,258 SPRITE_POSITION 7,380,258 END_SUB ' ------------------------------------------------------------------------------ SUB SpriteWave() DIM_LOCAL x%, y% DEGREES PICTURE 8 2D_TARGET_IS 8 WIDTH 8,300 HEIGHT 8,8 COLOR 8,0,0,0 2D_PEN_COLOR 255,255,0 2D_PEN_WIDTH 3 y%=(10*SIN(0))+4 2D_POLY_FROM 0,y% FOR x% = 0 TO 300 y%=(2*SIN(x%/390*360*20))+4 2D_POLY_TO x%,y% NEXT x% IMAGE 58 2D_IMAGE_COPY 58,0,0,300,8 SPRITE 15 SPRITE_IMAGE_LOAD 15,58 SPRITE_POSITION 15,140,48 END_SUB ' ------------------------------------------------------------------------------ SUB SpritesSmiley() DIM_LOCAL i% FOR i% = 1 to 5 picture i% 2D_TARGET_IS i% WIDTH i%,64 HEIGHT i%,64 COLOR i%,0,0,0 2D_PEN_COLOR 240,240,0 2D_CIRCLE 32,32,28 2D_FLOOD 32,32,250,250,0 DataRead(i%) SELECT i% CASE 1 2D_FLOOD 18,38,250,250,250 2D_FLOOD 28,43,250,250,250 2D_FLOOD 38,42,250,250,250 2D_FLOOD 48,38,250,250,250 CASE 2 2D_FLOOD 35,32,250,250,250 2D_FLOOD 45,43,250,0,0 CASE 3 2D_FLOOD 13,56,240,240,0 CASE 4 2D_FLOOD 21,25,250,250,250 2D_FLOOD 47,25,250,250,250 CASE 5 2D_FLOOD 14,54,240,240,0 2D_FLOOD 49,54,240,240,0 2D_FLOOD 6,43,240,240,0 2D_FLOOD 59,43,240,240,0 END_SELECT IMAGE i%+50 2D_IMAGE_COPY i%+50,0,0,64,64 SPRITE i% SPRITE_IMAGE_LOAD i%,i%+50 NEXT i% END_SUB ' ------------------------------------------------------------------------------ SUB DataRead(sp%) DIM_LOCAL n%,x%,y%,i%,a% 2D_TARGET_IS sp% READ n% 2D_PEN_COLOR 1,1,1 WHILE n% <> 0 FOR i%=0 to n%-1 IF MOD(a%, 2) <> 0 2D_POINT x%,y% END_IF x%=x%+1 IF x% = 64 x%=0 y%=y%+1 END_IF NEXT i% Read n% a%=a%+1 END_WHILE END_SUB ' ------------------------------------------------------------------------------ ' smiley 1 DATA 912,6,19,6,31,9,17,9,28,4,29,4,27,2,33,2,26,2,35,2,159,4,20,4,34,8,16,8,31,10,14,10,29,4,5,3,12,3,5,4,27,4,7,3,10,3,7,4,25,4,10 DATA 1,10,1,10,4,24,3,34,3,24,2,36,2,217,2,34,2,25,2,1,2,30,2,1,2,24,1,3,2,28,2,3,1,23,2,5,2,24,2,5,2,22,2,7,2,20,2,7,2,23,1 DATA 9,3,14,4,8,1,24,1,9,1,2,7,1,6,3,1,8,1,24,2,8,1,8,3,8,1,8,1,25,1,8,1,9,1,9,1,7,2,25,1,7,1,10,1,10,1,6,1,27,1,6 DATA 1,10,1,10,1,5,2,27,1,6,1,10,1,10,1,4,2,29,1,4,1,11,1,11,1,2,2,31,1,3,1,11,1,11,1,1,2,33,1,2,1,11,1,11,3,35,3,11,1,11,2 DATA 37,2,11,1,10,1,41,2,9,1,8,2,44,2,7,1,6,2,48,14,793,0 ' smiley 2 DATA 223,3,59,3,60,3,61,2,62,2,8,4,50,2,7,6,50,1,6,3,60,3,61,2,62,2,62,2,62,2,63,1,138,2,26,5,30,2,1,1,24,3,32,1,4,1,22,3,31,2,6 DATA 1,20,3,31,2,8,1,19,2,31,2,10,1,18,1,31,1,10,4,17,1,30,1,10,5,47,1,10,7,26,6,13,1,10,8,24,9,11,1,10,10,23,3,16,1,10,11,22,3,16,1 DATA 10,12,22,2,16,1,9,14,22,2,15,1,9,15,21,2,15,1,9,12,3,1,21,2,14,1,9,12,4,1,21,2,13,1,9,11,6,1,22,2,11,2,8,11,6,1,23,2,11,1,8 DATA 12,6,1,35,1,9,11,6,1,35,1,9,12,6,1,34,1,9,12,6,1,34,2,8,11,7,1,35,1,8,11,8,1,35,1,7,11,8,1,36,2,6,10,8,1,38,2,4,10,8,1 DATA 40,2,2,11,7,1,42,14,5,2,45,11,5,1,48,10,3,2,51,8,1,2,55,7,855,0 ' smiley 3 DATA 784,4,59,6,57,2,27,1,34,1,27,2,34,1,21,2,3,2,39,2,17,5,39,4,18,4,37,6,16,6,36,6,16,6,37,4,18,4,39,2,20,2,240,7,56,9,54,2,51,2,8 DATA 2,51,1,2,1,7,1,4,3,44,1,4,1,10,1,47,1,4,1,13,2,43,1,4,1,11,2,2,1,42,1,4,1,9,2,5,1,41,1,4,1,7,2,7,1,40,1,5,1,4,3 DATA 8,1,41,1,5,1,2,3,9,1,41,1,6,4,9,2,42,1,6,2,9,2,43,1,16,2,45,1,15,1,46,1,15,1,46,2,16,2,44,1,19,1,43,1,20,1,42,1,20,1,42 DATA 1,21,1,41,1,21,1,41,1,21,1,42,1,21,1,41,1,21,1,42,1,20,1,42,1,20,1,43,1,18,2,44,1,17,1,45,1,16,2,46,1,13,3,48,2,7,4,53,7,299,0 ' smiley 4 DATA 1425,4,23,3,33,6,20,6,30,9,18,9,28,5,3,1,18,4,3,2,27,6,3,2,16,5,3,3,26,6,3,2,16,5,3,3,26,11,16,11,26,11,16,10,28,10,17,9,28,9,19 DATA 7,31,6,21,5,34,2,25,1,419,2,26,2,34,3,25,2,35,2,24,2,37,2,22,2,39,2,20,2,41,3,17,2,43,4,12,4,46,16,51,10,987,0 ' smiley 5 DATA 914,3,23,4,32,6,20,8,29,3,4,1,18,2,5,2,28,2,33,2,27,2,34,1,27,1,322,7,16,7,33,9,14,9,31,4,4,3,12,3,4,4,30,2,7,3,11,2,7,3,28 DATA 2,9,1,12,1,9,2,29,1,32,2,286,2,29,1,32,3,27,2,33,2,27,2,33,2,26,2,35,2,25,2,2,1,28,3,1,3,23,2,2,3,26,1,2,1,2,3,20,3,2,1 DATA 2,1,26,1,3,1,2,4,17,3,3,1,2,1,17,3,6,1,3,1,4,4,13,4,3,1,3,1,5,5,6,1,3,3,3,2,3,1,4,18,5,1,3,1,3,3,3,1,6,1,5 DATA 3,2,1,3,1,7,13,6,1,3,1,2,3,5,1,7,2,5,4,4,1,25,1,3,4,5,2,10,2,6,1,4,2,23,1,5,1,5,2,7,3,4,2,10,2,21,1,11,1,4,3 DATA 1,1,3,8,9,1,20,1,10,2,2,3,3,2,8,3,10,1,19,1,10,4,6,5,18,1,18,2,18,2,5,3,15,1,18,1,15,4,10,3,12,1,18,1,12,3,7,10,12,1,18 DATA 1,12,9,1,1,21,1,18,1,21,3,19,1,19,1,20,1,3,8,11,1,20,1,12,7,10,2,10,1,22,1,10,2,14,2,12,1,22,1,12,3,9,2,13,1,24,1,14,1,8,1 DATA 3,5,4,2,26,2,4,5,3,1,9,3,5,4,30,4,5,3,133,0
| |
|