This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const entities = { | |
| amp: "&", | |
| apos: "'", | |
| lt: "<", | |
| gt: ">", | |
| quot: '"', | |
| nbsp: "\xa0", | |
| ouml: "ö", | |
| auml: "ä", | |
| uuml: "ü", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { FC } from "react" | |
| import { observer } from "mobx-react-lite" | |
| import { TextStyle, View, ViewStyle } from "react-native" | |
| import { AppStackScreenProps } from "app/navigators" | |
| import { Screen, Text } from "app/components" | |
| import { spacing } from "app/theme" | |
| // import { useNavigation } from "@react-navigation/native" | |
| // import { useStores } from "app/models" | |
| interface QuestionScreenProps extends AppStackScreenProps<"Question"> {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { FC, useEffect } from "react" | |
| import { observer } from "mobx-react-lite" | |
| import { TextStyle, View, ViewStyle } from "react-native" | |
| import { AppStackScreenProps } from "app/navigators" | |
| import { ListView, Screen, Text } from "app/components" | |
| import { colors, spacing } from "app/theme" | |
| import { Question, useStores } from "app/models" | |
| import { decodeHTMLEntities } from "app/utils/decodeHtml" | |
| import { ContentStyle } from "@shopify/flash-list" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import shuffle from "lodash.shuffle" | |
| export const QuestionModel = types | |
| .model("Question") | |
| .props({ | |
| id: types.identifier, | |
| category: types.maybe(types.string), | |
| type: types.enumeration(["multiple", "boolean"]), | |
| difficulty: types.enumeration(["easy", "medium", "hard"]), | |
| question: types.maybe(types.string), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| import { RadioGroup } from "react-native-radio-buttons-group" | |
| ... | |
| export const QuestionScreen: FC<QuestionScreenProps> = observer(function QuestionScreen() { | |
| ... | |
| const onPressAnswer = (question: Question, guess: string) => { | |
| question.setGuess(guess) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import PIL.Image | |
| import numpy as np | |
| def image_to_ascii(image_path, output_path, ascii_char='#', width=100): | |
| """ | |
| Convert a black and white image to ASCII art using a single character | |
| Args: | |
| image_path: Path to the input image | |
| output_path: Path to save the ASCII art as text file |
OlderNewer