Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: hexa : 000000 = 0
- :: 000001 = 1
- :: 000010 = 2
- :: 000011 = 3
- :: etc
- :: %s1% est le premier bit en partant de la gauche etc.
- :: Génère un fichier bin.log
- :: (c) Hugo7
- @echo off
- cls
- setlocal enabledelayedexpansion
- set /p str=Entrez 6 bits ^(la ou on veut commencer, sinon mettre 000000^) ^>
- for /L %%A in () do (
- set s1=!str:~0,1!
- set s2=!str:~1,1!
- set s3=!str:~2,1!
- set s4=!str:~3,1!
- set s5=!str:~4,1!
- set s6=!str:~5,1!
- title !str! = !s1! !s2! !s3! !s4! !s5! !s6!
- if !s6!==0 (
- set s6=1
- ) else if !s6!==1 if !s5!==0 (
- :: quand 000001 alors 000010
- set s5=1
- set s6=0
- ) else if !s6!==1 if !s5!==1 if !s4!==0 (
- :: quand 000011 alors 000100
- set s4=1
- set s6=0
- set s5=0
- ) else if !s6!==1 if !s5!==1 if !s4!==1 if !s3!==0 (
- :: quand 000111 alors 001000
- set s3=1
- set s6=0
- set s5=0
- set s4=0
- ) else if !s6!==1 if !s5!==1 if !s4!==1 if !s3!==1 if !s2!==0 (
- :: quand 001111 alors 010000
- set s2=1
- set s6=0
- set s5=0
- set s4=0
- set s3=0
- ) else if !s6!==1 if !s5!==1 if !s4!==1 if !s3!==1 if !s2!==1 if !s1!==0 (
- :: quand 011111 alors 100000
- set s1=1
- set s6=0
- set s5=0
- set s4=0
- set s3=0
- set s2=0
- )
- set str=!s1!!s2!!s3!!s4!!s5!!s6!
- echo !str! >>bin.log
- if !str!==111111 (
- echo fini
- pause
- exit
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement