Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/08/2020 in all areas

  1. Saying "Const Enum" is redundant. An Enum is implicitly constant. If you look at the help file for Enum, you do not see an option to use "Const". As to why declaring a "Const Enum" doesn't trigger a syntax error, I don't know. That's a good question.
    1 point
  2. No, it wouldn’t. Scraping never does. Though in this case, the code was primarily designed to provoke severe cognitive dissonance in anyone actually using it. Just for the sake of completeness, would you like to state your reasons for not integrating using plink, which provides stream access to stdin and stdout?
    1 point
  3. As there is a complete symmetry (horizontal & vertical), you could check only the left upper quadrant and fill the symmetric cells, something like this : #include <array.au3> Local $iOdd = 15, $tt[$iOdd][$iOdd] _Build($tt, $iOdd) _ArrayDisplay($tt) Func _Build(ByRef $filtre, $iOdd) Local $iOdd2 = Int($iOdd / 2) - 1 ; $iOdd = 15 => $iOdd2 = 6 For $iRow = 0 To $iOdd2 ; 0 To 6 (no matter $iOdd2 will be decremented later) For $iCol = 0 To $iOdd2 ; 0 To 6, then 0 To 5... until 0 To 0 $filtre[$iRow][$iCol] = "X" ; left upper quadrant $filtre[$iRow][$iOdd - $iCol - 1] = "X" ; right upper quadrant $filtre[$iOdd - $iRow - 1][$iCol] = "X" ; left lower quadrant $filtre[$iOdd - $iRow - 1][$iOdd - $iCol - 1] = "X" ; right lower quadrant Next $iOdd2 -= 1 ; from 6 To 0 Next EndFunc
    1 point
  4. Small addendum : As long as each cell of the field can have only two states (Black=1, White=0) you can represent each line with a single value. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 (64) (32) (16) (8) (4) (2) (1) 1 1 1 0 1 1 1 <== first row ==> 119 (Dec) or 77 (Hex)
    1 point
  5. #include <Array.au3> ; 1 = Black, 0 = White Global $g_aCells = [[1,1,1,0,1,1,1], _ [1,1,0,0,0,1,1], _ [1,0,0,0,0,0,1], _ [0,0,0,0,0,0,0], _ [1,0,0,0,0,0,1], _ [1,1,0,0,0,1,1], _ [1,1,1,0,1,1,1]] _ArrayDisplay($g_aCells) For $iRow = 0 To 6 For $iCol = 0 To 6 If $g_aCells[$iCol][$iRow] = 1 Then ConsoleWrite("+ $iCol:" & $iCol & " $iRow:" & $iRow & " is BLACK" & @CRLF) Else ConsoleWrite("> $iCol:" & $iCol & " $iRow:" & $iRow & " is WHITE" & @CRLF) EndIf Next ConsoleWrite(" -----------------------------" & @CRLF) Next
    1 point
  6. Dan_555

    Online txt file reader

    Hi. You have to either delete the input controls or to delete the text from them. Something like this: #include <File.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $hGUI = GUICreate("Standby File Check", 355, 700, -1, -1) GUISetState(@SW_SHOW) Global $sRow = 23, $iColum = 4, $iLinesmax = 2000 Global $aGUI[$iLinesmax][$iColum] AdlibRegister("_Readed", 1000) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Readed() If IsArray($aGUI) Then For $x = 0 To $iLinesmax - 1 For $y = 0 To $iColum - 1 GUICtrlDelete($aGUI[$x][$y]) Next Next EndIf Local $aFile, $fRow = 20 _FileReadToArray(@ScriptDir & "\" & @YEAR & @MON & @MDAY & ".txt", $aFile, 0) Local $iLines = UBound($aFile) For $i = 0 To $iLines - 1 $aTemp = StringSplit($aFile[$i], "|", 2) ReDim $aTemp[$iColum] If $iLines < $iLinesmax-1 Then $aGUI[$i][0] = GUICtrlCreateInput($aTemp[0], 20, $fRow + ($sRow * $i), 70, 20) $aGUI[$i][1] = GUICtrlCreateInput($aTemp[1], 95, $fRow + ($sRow * $i), 110, 20) $aGUI[$i][2] = GUICtrlCreateInput($aTemp[2], 210, $fRow + ($sRow * $i), 70, 20) $aGUI[$i][3] = GUICtrlCreateInput($aTemp[3], 285, $fRow + ($sRow * $i), 50, 20) EndIf Next EndFunc ;==>_Readed
    1 point
×
×
  • Create New...